OpenBoot 2.x Command Reference Manual

Using Numbers

Enter a number by typing its value, for example, 55 or -123. Forth accepts only integers (whole numbers); fractional values (for example, 2/3) are not allowed. A period at the end of a number signifies a double number. Periods or commas embedded in a number are ignored, so 5.77 is understood as 577. By convention, such punctuation usually appears every four digits. Use one or more spaces to separate a number from a word or from another number.

OpenBoot performs 32-bit integer arithmetic, and all numbers are 32-bit values unless otherwise specified.

Although OpenBoot implementations are encouraged to provide a hexadecimal conversion radix, they are not required to do so. So, you must establish such a radix if your code depends on a given base for proper operation.

You can change the operating number base with the commands octal, decimal and hex which cause all subsequent numeric input and output to be performed in base 8, 10 or 16, respectively.

For example, to operate in decimal, type:


ok decimal 
ok 

To change to hexadecimal type:


ok hex 
ok 

Two simple techniques for identifying the active number base are:


ok 10 .d
16
ok 10 1- .
f
ok 

The 16 and the f on the display show that you are operating in hexadecimal. If 10 and 9 showed on the display, it would mean that you are in decimal base. 8 and 7 would indicate octal.