DECIMAL   HEX   BIN   BASE

DECIMAL ( ---)

Selects the decimal number base. It is the default digital base when FORTH starts.

Exemple:

255 HEX . DECIMAL   \ display FF

HEX ( ---)

Selects the hexadecimal digital base.

Example:

255 HEX .   \ display FF
DECIMAL     \ return to decimal base

BIN ( ---)

Specific Flash Forth

Select binary base.

Example:

255 HEX .   \ display 11111111
DECIMAL     \ return to decimal base

BASE ( --- addr)

Single precision variable determining the current numerical base.

The BASE variable contains the value 10 (decimal) when FORTH starts.

To switch to binary:

DECIMAL     \ select decimal base
2 BASE !    \ selevt binary base

Now you can only type numbers in binary. To return to decimal base, type DECIMAL.

You can enter any number base from 2 to 32!