This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
tutorials:forth [2022/03/07 16:41] lars Add a section for John Wilson's FORTH. |
tutorials:forth [2022/06/07 02:10] (current) rcs correct lack of space after dot commands in examples |
||
|---|---|---|---|
| Line 21: | Line 21: | ||
| 7 3 Ok ( Push 7 then 3 on stack. ) | 7 3 Ok ( Push 7 then 3 on stack. ) | ||
| + Ok ( Remove two items from stack (3 and 7), push the sum on stack, so 10 is only item. ) | + Ok ( Remove two items from stack (3 and 7), push the sum on stack, so 10 is only item. ) | ||
| - | .10 Ok ( Word . pops top stack item and prints it. Stack is now empty. ) | + | . 10 Ok ( Word . pops top stack item and prints it. Stack is now empty. ) |
| | | ||
| Words '' | Words '' | ||
| 3.14159 Ok | 3.14159 Ok | ||
| - | f.3.14159 Ok ( f. pops stack and displays as floating-point. ) | + | f. 3.14159 Ok ( f. pops stack and displays as floating-point. ) |
| | | ||
| Add new words to the dictionary with the defining words '':'' | Add new words to the dictionary with the defining words '':'' | ||
| Line 37: | Line 37: | ||
| ( previous top value, multiply and push product on stack. | ( previous top value, multiply and push product on stack. | ||
| 7 TIMES5 Ok ( Execute the word. ) | 7 TIMES5 Ok ( Execute the word. ) | ||
| - | .35 Ok ( Pop and display result. ) | + | . 35 Ok ( Pop and display result. ) |
| | | ||
| List words currently defined in the dictionary with '' | List words currently defined in the dictionary with '' | ||