|
4 | 4 | \ This is PUBLIC DOMAIN (see public domain release statement below). |
5 | 5 | \ $Id: jonesforth.f,v 1.18 2009-09-11 08:32:33 rich Exp $ |
6 | 6 | \ |
7 | | -\ The first part of this tutorial is in jonesforth.S. Get if from http://annexia.org/forth |
| 7 | +\ The first part of this tutorial is in jonesforth.S. Get it from http://annexia.org/forth |
8 | 8 | \ |
9 | 9 | \ PUBLIC DOMAIN ---------------------------------------------------------------------- |
10 | 10 | \ |
|
82 | 82 | [ \ go into immediate mode (temporarily) |
83 | 83 | CHAR : \ push the number 58 (ASCII code of colon) on the parameter stack |
84 | 84 | ] \ go back to compile mode |
85 | | - LITERAL \ compile LIT 58 as the definition of ':' word |
| 85 | + LITERAL \ compile LIT 58 for the definition of the ':' word |
86 | 86 | ; |
87 | 87 |
|
88 | 88 | \ A few more character constants defined the same way as above. |
|
130 | 130 | \ where OFFSET is the offset of 'rest' |
131 | 131 | \ condition IF true-part ELSE false-part THEN |
132 | 132 | \ -- compiles to: --> condition 0BRANCH OFFSET true-part BRANCH OFFSET2 false-part rest |
133 | | -\ where OFFSET if the offset of false-part and OFFSET2 is the offset of rest |
| 133 | +\ where OFFSET is the offset of false-part and OFFSET2 is the offset of rest |
134 | 134 |
|
135 | 135 | \ IF is an IMMEDIATE word which compiles 0BRANCH followed by a dummy offset, and places |
136 | 136 | \ the address of the 0BRANCH on the stack. Later when we see THEN, we pop that address |
|
218 | 218 | \ FORTH allows ( ... ) as comments within function definitions. This works by having an IMMEDIATE |
219 | 219 | \ word called ( which just drops input characters until it hits the corresponding ). |
220 | 220 | : ( IMMEDIATE |
221 | | - 1 \ allowed nested parens by keeping track of depth |
| 221 | + 1 \ allows nested parens by keeping track of depth |
222 | 222 | BEGIN |
223 | 223 | KEY \ read next character |
224 | 224 | DUP '(' = IF \ open paren? |
@@ -288,7 +288,7 @@ \ FORTH allows ( ... ) as comments within function definitions. This works by h |
288 | 288 | will print out these characters: |
289 | 289 | <space> <space> - 1 2 3 |
290 | 290 |
|
291 | | - In other words, the number padded left to a certain number of characters. |
| 291 | + In other words, the number padded on the left to a certain number of characters. |
292 | 292 |
|
293 | 293 | The full number is printed even if it is wider than width, and this is what allows us to |
294 | 294 | define the ordinary functions U. and . (we just set width to zero knowing that the full |
@@ -1393,7 +1393,7 @@ EXCEPTION-MARKER, namely a function that just drops the stack frame and itself |
1393 | 1393 | To make it more like a C string, at runtime Z" just leaves the address of the string |
1394 | 1394 | on the stack (not address & length as with S"). To implement this we need to add the |
1395 | 1395 | extra NUL to the string and also a DROP instruction afterwards. Apart from that the |
1396 | | - implementation just a modified S". |
| 1396 | + implementation is just a modified S". |
1397 | 1397 | ) |
1398 | 1398 | : Z" IMMEDIATE |
1399 | 1399 | STATE @ IF ( compiling? ) |
@@ -1520,7 +1520,7 @@ EXCEPTION-MARKER, namely a function that just drops the stack frame and itself |
1520 | 1520 | ( |
1521 | 1521 | UNUSED returns the number of cells remaining in the user memory (data segment). |
1522 | 1522 |
|
1523 | | - For our implementation we will use Linux brk(2) system call to find out the end |
| 1523 | + For our implementation we will use the Linux brk(2) system call to find out the end |
1524 | 1524 | of the data segment and subtract HERE from it. |
1525 | 1525 | ) |
1526 | 1526 | : GET-BRK ( -- brkpoint ) |
|
0 commit comments