Stack comments in Retro are a compact form, using short codes in place of actual words. These codes are listed in the next section.
A typical comment for a word that takes two arguments and leaves one will look like:
( xy-z )
In a few cases, words may consume or leave a variable number of arguments. In this case, we denote it like:
( n-n || n- )
There are two other modifiers in use. Some words have different compile-time and run-time stack use. We prefix the comment with C: for compile-time, and R: for run-time actions.
If not specified, the stack comments are for runtime effects. Words with no C: are assumed to have no stack impact during compilation.
Codes used in the stack comments:
x, y, z, n | Generic numbers |
q, r | Quotient, Remainder (for division) |
" |
Word parses for a string |
a | Address |
c | ASCII character |
$ |
Zero-terminated string |
f | Flag |
... | Variable number of values on stack |