Writing Device Drivers

Forth Commands

The Open Boot PROM uses the Forth programming language. This is a stack-based language; arguments must be pushed on the stack before running the correct command (called a word), and the result is left on the stack.

To place a number on the stack, type its value.

ok 57ok 68

To add the two top values on the stack, use the + operator.

ok +

The result remains on the stack. The stack is shown with the .s word.

ok .sbf 

The default base is hexadecimal. The hex and decimal words can be used to switch bases.

ok decimalok .s191 

See the Forth User's Guide for more information.