The names from the system itself (the hosted v4's WORDS, plus the kernel's sk_v4_words[]); the stack notation and description in docs/reference/v4-dictionary.tsv, drafted from the source where it says (54 stacks, 105 descriptions), the rest to write. check refuses a missing, unfinished or stale entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
19 KiB
19 KiB
| 1 | # docs/reference/v4-dictionary.tsv -- the dictionary of v4 (#157): name, stack notation, | ||
|---|---|---|---|
| 2 | # description, tab-separated. The names are the live system's (v4/tools/mkdictionary.py | ||
| 3 | # check refuses a missing or a stale one). A row whose description starts TODO is a draft. | ||
| 4 | ! | TODO | |
| 5 | # | TODO | |
| 6 | #> | TODO | |
| 7 | #S | TODO | |
| 8 | ' | ( -- addr ) | TODO FORTH-79: the next word's parameter field address; if compiling, compiled as a literal |
| 9 | ( | TODO ---- comments (5.15) ------------------------------------------------------- PAREN skips to the closing parenthesis; BACKSLASH skips the rest of the line. | |
| 10 | (BITS) | ( -- n ) | TODO |
| 11 | (CONSOLE) | TODO | |
| 12 | (LOST) | TODO | |
| 13 | (ME) | TODO | |
| 14 | (NB) | TODO | |
| 15 | (REFUSED) | TODO | |
| 16 | (SEAL) | ( -- ) | TODO WHAT IS IN THE DICTIONARY NOW IS THE SYSTEM: COLD comes back to it and FORGET will not go below it. Whoever has loaded a node's capsules has it do this (system.f18, (BOOT) and FENCE). |
| 17 | (UD) | TODO | |
| 18 | (WORD-DEFINED) | TODO | |
| 19 | (WORD-FORGOTTEN) | TODO | |
| 20 | * | TODO The low cell of the product, by N steps of +* with nothing but the count on the return stack. UM* drop gives the same cell but needs two more return entries, which a word inside two DO loops does not have (D-2). The low cell is exact: what +* loses at the top of T (D-3) takes N shifts to reach the bit that moves into A, and the loop ends first. | |
| 21 | */ | TODO | |
| 22 | */MOD | TODO | |
| 23 | + | TODO ---- arithmetic ---- | |
| 24 | +! | TODO | |
| 25 | +LOOP | TODO | |
| 26 | , | TODO , calls nothing: the code generator calls it from as deep as anything goes. | |
| 27 | - | TODO | |
| 28 | -! | TODO | |
| 29 | --> | ( -- ) | TODO go on with the next block. Only in a block being loaded: at the terminal it is an error (code 14). |
| 30 | -ROT | TODO | |
| 31 | -TRAILING | TODO | |
| 32 | . | TODO | |
| 33 | .R | TODO | |
| 34 | .S | ( -- ) | TODO as v3: the depth between < and >, then every value on the stack, the deepest first, each followed by a blank; then a new line. The stack is left as it was. It reads each value with PICK, so it needs a few cells of the stack free to work in. |
| 35 | / | TODO | |
| 36 | /MOD | TODO | |
| 37 | 0< | TODO | |
| 38 | 0<> | TODO ---- comparison ---- | |
| 39 | 0= | TODO | |
| 40 | 0> | TODO | |
| 41 | 1+ | TODO | |
| 42 | 1- | TODO | |
| 43 | 2! | TODO | |
| 44 | 2* | TODO | |
| 45 | 2+ | TODO | |
| 46 | 2, | TODO | |
| 47 | 2- | TODO | |
| 48 | 2/ | TODO | |
| 49 | 2>R | TODO | |
| 50 | 2@ | TODO ---- memory ---- | |
| 51 | 2DROP | TODO | |
| 52 | 2DUP | TODO | |
| 53 | 2OVER | TODO | |
| 54 | 2R> | TODO | |
| 55 | 2R@ | TODO | |
| 56 | 2ROT | TODO | |
| 57 | 2SWAP | TODO ---- stack ---- | |
| 58 | 79-STANDARD | TODO FORTH-79: execute to be sure a FORTH-79 system is there. It is: nothing happens. (v3's prints two lines and leaves a flag.) | |
| 59 | : | TODO FORTH-79: start a definition; it cannot be found until ; ends it. The CONTEXT vocabulary is set to the CURRENT one. (C)+2 holds LATEST while the entry is made, to tell whether one was. | |
| 60 | ; | TODO FORTH-79: compile the return, let the word be found, stop compiling | |
| 61 | < | TODO | |
| 62 | <# | TODO ---- pictured output ---- | |
| 63 | <= | TODO | |
| 64 | <> | TODO | |
| 65 | = | TODO | |
| 66 | > | TODO | |
| 67 | >= | TODO | |
| 68 | >BODY | TODO | |
| 69 | >IN | TODO | |
| 70 | >LINK | TODO | |
| 71 | >NAME | TODO | |
| 72 | >R | TODO ---- return stack: in line, and only inside a definition ---- | |
| 73 | ? | ( addr -- ) | TODO print what the cell holds |
| 74 | ?DO | TODO | |
| 75 | ?DUP | TODO | |
| 76 | ?TERMINAL | TODO ---- strings and memory ---- | |
| 77 | @ | TODO ---- memory ---- | |
| 78 | ABS | TODO | |
| 79 | ACL-ALLOW! | TODO | |
| 80 | ACL-ALLOW@ | TODO | |
| 81 | ACL-HEAT@ | ( xt -- heat ) | TODO how often the word has been used. The node's heat counters are not readable from a programme yet (D-6): 0. |
| 82 | ACL-HOOK | TODO | |
| 83 | ACL-INHERIT | ( src dst -- ) | TODO as v3: dst takes src's mode; it is not pinned, its TTL is 0 and it is allowed. This is the one word that unpins. |
| 84 | ACL-INIT-PRIMITIVES | ( -- ) | TODO as v3: do that to every word in the dictionary, in every vocabulary |
| 85 | ACL-MODE! | TODO | |
| 86 | ACL-MODE@ | TODO | |
| 87 | ACL-PIN | TODO | |
| 88 | ACL-PINNED? | TODO | |
| 89 | ACL-TTL! | TODO as v3: below 0 is 0. The TTL is sixteen bits here: above 65535 is 65535. | |
| 90 | ACL-TTL@ | TODO | |
| 91 | ACL-WORD-ID | ( xt -- n ) | TODO a number for the word that never changes: its address |
| 92 | AGAIN | TODO | |
| 93 | ALIGN | TODO | |
| 94 | ALLOT | TODO | |
| 95 | AND | TODO ---- logic and comparison ---- | |
| 96 | BASE | TODO | |
| 97 | BEGIN | TODO A loop that tests at its end jumps back with the flag still there, so it jumps back to a drop laid just ahead of the body: BEGIN a UNTIL jump L0 Ld: drop L0: a if Ld drop BEGIN a WHILE b REPEAT jump L0 Ld: drop L0: a if Lx drop b jump L0 Lx: drop BEGIN a AGAIN jump L0 Ld: drop L0: a jump L0 The control-flow stack holds Ld, L0 and 3. | |
| 98 | BL | TODO ---- in-line addresses and constants ---- | |
| 99 | BLANK | TODO | |
| 100 | BLK | TODO | |
| 101 | BLOCK | ( n -- baddr ) | TODO FORTH-79: the address of a buffer that holds block n, read from storage if it is not already in one. |
| 102 | BUFFER | ( n -- baddr ) | TODO FORTH-79: the address of a buffer assigned to block n. What the buffer holds is not read from storage. |
| 103 | BYE | TODO | |
| 104 | C! | TODO | |
| 105 | C, | TODO | |
| 106 | C@ | TODO | |
| 107 | CASE | TODO | |
| 108 | CELLS | TODO | |
| 109 | CFA | TODO | |
| 110 | CMOVE | TODO ---- section 5.9: strings ------------------------------------------------ | |
| 111 | CMOVE> | TODO | |
| 112 | COLD | ( -- ) | TODO the system as it was when the capsule had just been loaded: everything defined since is gone, there is one vocabulary, numbers are decimal, the block buffers are empty. Then as WARM. |
| 113 | COMPARE | TODO | |
| 114 | COMPILE | TODO COMPILE xxx FORTH-79: when the word this is in runs, xxx is compiled | |
| 115 | CONSTANT | ( n -- ) | TODO FORTH-79: an entry whose word leaves n |
| 116 | CONTEXT | TODO ---- vocabularies (FORTH-79) ---------------------------------------------------- A vocabulary is two cells: its head -- the xt of its newest entry, or 0 -- and the address of the vocabulary defined before it, or 0. VOC-LINK holds the newest one's address. FORTH's head is (LATEST) and it is in no chain. | |
| 117 | CONVERT | ( d1 baddr1 -- d2 baddr2 ) | TODO FORTH-79: the characters from baddr1 + 1 on are taken as digits in the current BASE, each accumulated into the double after it is multiplied by BASE, until one is not a digit; baddr2 is its address. (P)+2 holds the digit while the double is multiplied and (P)+5 the address, so nothing waits on the return stack across the calls. |
| 118 | COUNT | TODO | |
| 119 | CR | TODO | |
| 120 | CREATE | TODO FORTH-79: an entry whose word leaves the address of its parameter field | |
| 121 | CURRENT | TODO | |
| 122 | D+ | TODO ---- section 5.7: doubles ------------------------------------------------ | |
| 123 | D- | TODO ---- doubles and mixed ---- | |
| 124 | D. | TODO | |
| 125 | D.R | TODO | |
| 126 | D0< | TODO | |
| 127 | D0= | TODO | |
| 128 | D2* | TODO | |
| 129 | D2/ | TODO | |
| 130 | D< | TODO | |
| 131 | D= | TODO | |
| 132 | DABS | TODO | |
| 133 | DECIMAL | TODO | |
| 134 | DEFAULT-ROUTE | ( port -- ) | TODO the port, by its number, leads toward every node not told of |
| 135 | DEFER | TODO | |
| 136 | DEFER@ | TODO | |
| 137 | DEFINITIONS | TODO FORTH-79: new definitions go into the CONTEXT vocabulary from now on. | |
| 138 | DEPTH | TODO FORTH-79: how many values were on the stack before DEPTH | |
| 139 | DMAX | TODO | |
| 140 | DMIN | TODO | |
| 141 | DNEGATE | TODO | |
| 142 | DO | TODO | |
| 143 | DOES> | TODO | |
| 144 | DROP | TODO | |
| 145 | DUMP | TODO | |
| 146 | DUP | TODO ---- stack ---- | |
| 147 | ELSE | TODO | |
| 148 | EMIT | TODO EMIT puts the character with what has been printed. Everything the node prints goes through EMIT. A is kept: the words that print have always been free to use it across an EMIT. As v3, only the low 8 bits of the character are printed. A BUFFER FOUND FULL is sent first. It is full when a flush of it ended in a fault -- the stack too deep to begin a message -- and what is printed next is that fault's own message: put where (OUT^) points, it would go past the buffer's end, and (OUT^) would never again be at the end to be flushed (MESH.md 7c.6). | |
| 149 | EMPTY-BUFFERS | TODO FORTH-79: forget what is in the buffers; nothing is written. | |
| 150 | ENCLOSE | ( baddr c -- baddr n1 n2 n3 ) | TODO in the zero-terminated string at baddr: n1 the offset of the first character that is not c, n2 the offset of the first c after it, n3 the offset of the first character after that run of c. |
| 151 | ENDCASE | TODO | |
| 152 | ENDOF | TODO | |
| 153 | ERASE | TODO | |
| 154 | EXECUTE | TODO | |
| 155 | EXIT | TODO FORTH-79: return from the definition at this point | |
| 156 | EXPECT | ( baddr n -- ) | TODO FORTH-79: characters from the terminal are stored from baddr upward until a new-line or until n have been received; the new-line is taken but not stored. A zero is added after the text, so the buffer must hold n + 1 bytes. No action for n <= 0. SPAN is how many characters were stored (SPAN is not FORTH-79; v3 has it). A line longer than n leaves the rest, its new-line included, to be read next. It is what the prompt reads every line with, with whatever the user has left on the stack beneath it, so it works in (P) -- (P)+0 where the next character goes, (P)+1 how many more may come, (P)+2 where the first went -- and has at most three cells of its own on the data stack (D-2). |
| 157 | FALSE | TODO | |
| 158 | FENCE | TODO | |
| 159 | FILL | TODO | |
| 160 | FIND | ( -- xt | 0 ) | TODO FORTH-79: the compilation address of the next word in the input stream, or 0 if it is not in the dictionary. |
| 161 | FLUSH | TODO As v3: the same. | |
| 162 | FORTH | TODO FORTH-79: the primary vocabulary; it becomes the CONTEXT vocabulary. | |
| 163 | GONE | ( n node -- ) | TODO tell the node that node n is gone. It acts on that only if this node is its centre: it forgets the way to n, and if it is waiting for n's answer the wait ends. |
| 164 | HERE | TODO | |
| 165 | HEX | TODO | |
| 166 | HIDDEN | TODO | |
| 167 | HOLD | TODO | |
| 168 | I | TODO | |
| 169 | IF | TODO Native if leaves the flag, so both ways out of it drop it (section 2): IF a THEN if L1 drop a jump L2 L1: drop L2: IF a ELSE b THEN if L1 drop a jump L2 L1: drop b L2: | |
| 170 | IMMEDIATE | TODO | |
| 171 | INTERPRET | ( -- ) | TODO FORTH-79: take words from the input stream until it is exhausted. A word in the dictionary is executed, or, when compiling and not immediate, compiled. Anything else must be a number in the current BASE: it is left on the stack, or compiled as a literal. What is neither, or a compile-only word met while interpreting, abandons the line, with v3's message: UNKNOWN WORD: 'xxx' xxx: compile-only |
| 172 | INVERT | TODO | |
| 173 | IS | TODO | |
| 174 | J | TODO | |
| 175 | KEY | TODO | |
| 176 | LATEST | TODO | |
| 177 | LEAVE | TODO | |
| 178 | LFA | TODO | |
| 179 | LINK> | TODO | |
| 180 | LITERAL | ( x -- ) | TODO FORTH-79: if compiling, compile x as a literal |
| 181 | LOAD | ( n -- ) | TODO FORTH-79: interpret block n, then go on with what follows. |
| 182 | LOG-DEBUG | TODO | |
| 183 | LOG-DEBUG-STR | ( baddr u -- ) | TODO |
| 184 | LOG-ERROR | TODO | |
| 185 | LOG-ERROR-STR | ( baddr u -- ) | TODO |
| 186 | LOG-INFO | TODO | |
| 187 | LOG-INFO-STR | ( baddr u -- ) | TODO |
| 188 | LOG-LEVEL! | ( n -- ) | TODO as v3: a level below 0 is 0, one above 4 is 4 |
| 189 | LOG-LEVEL@ | TODO | |
| 190 | LOG-TEST | TODO | |
| 191 | LOG-TEST-STR | ( baddr u -- ) | TODO |
| 192 | LOG-WARN | TODO | |
| 193 | LOG-WARN-STR | ( baddr u -- ) | TODO |
| 194 | LOOP | TODO | |
| 195 | M* | TODO The product's sign waits in (F), not on the return stack, for the same reason as SM/REM's. | |
| 196 | M+ | TODO | |
| 197 | M- | TODO | |
| 198 | M/MOD | TODO | |
| 199 | MAX | TODO | |
| 200 | MIN | TODO | |
| 201 | MINT-ZUSE | TODO | |
| 202 | MOD | TODO | |
| 203 | MOVE | TODO FORTH-79: n cells from addr1 to addr2, the cell at addr1 first. | |
| 204 | NAME> | TODO | |
| 205 | NEGATE | TODO | |
| 206 | NEIGHBOUR | ( node port -- ) | TODO the node on the other end of the port, by its number; 0: none, or a device. Whoever wires the node tells it, and tells it again when the wiring changes. It is how a node knows who its centre is, the one node whose GONE it believes: (CENTRE). |
| 207 | NFA | TODO | |
| 208 | NO-ROUTE | ( node -- ) | TODO forget the way to that node, if one is known: what is for it then goes by the way for every node not told of, if there is one. The last way in the table takes its place. |
| 209 | NO-ROUTES | ( -- ) | TODO forget every way: for when the wiring has changed |
| 210 | NODE-ERROR | TODO FORTH-79: clear the return stack, set execution mode, return control to the terminal; no message is given. The data stack is left as it is. NODE-ERROR, by name: how a definition written in FORTH raises an error. A store of a code that is not zero is the trap of D-18 -- the word goes no further, the message for the code is printed (-1: the word has printed its own) and the line ends with ERROR. The codes are listed in core.f18. | |
| 211 | NOP | TODO | |
| 212 | NOT | TODO | |
| 213 | NUMBER | ( baddr -- d ) | TODO FORTH-79. What is not a number gives 0 and sets NODE-ERROR. |
| 214 | OCTAL | TODO | |
| 215 | OF | TODO | |
| 216 | OR | TODO | |
| 217 | ORDER | ( -- ) | TODO as v3's, but true: where names are looked for, and where new ones go |
| 218 | OVER | TODO | |
| 219 | PAD | TODO | |
| 220 | PAGE | ( -- ) | TODO clear the screen and put the cursor at the top, as v3: ESC [2J ESC [H |
| 221 | PFA | TODO | |
| 222 | PICK | ( n -- x ) | TODO FORTH-79: a copy of the n-th value, not counting n itself. 1 PICK is DUP, 2 PICK is OVER. n less than one is an error. |
| 223 | PORT! | ( w port -- ) | TODO write a cell to the port, by its number. It waits until the neighbour has taken it. This is how a node is sent a capsule of F18 code (docs/v4.0.0/MESH.md section 5): the cells go as they are, not as a message, to a node that is executing from its ports. |
| 224 | Q.* | TODO ---- multiply ---- | |
| 225 | Q.+ | TODO ---- the double words under other names ---- | |
| 226 | Q.- | TODO | |
| 227 | Q./ | TODO | |
| 228 | Q.0 | TODO | |
| 229 | Q.0= | TODO | |
| 230 | Q.1 | TODO | |
| 231 | Q.< | TODO | |
| 232 | Q.= | TODO | |
| 233 | Q.> | TODO | |
| 234 | Q.ABS | TODO | |
| 235 | Q.COS | TODO | |
| 236 | Q.EXP | TODO ---- e to the x ---- | |
| 237 | Q.FROM-INT | TODO ---- conversion and constants ---- | |
| 238 | Q.LOG | TODO ---- natural logarithm ---- | |
| 239 | Q.MAX | TODO | |
| 240 | Q.MIN | TODO | |
| 241 | Q.NEG | TODO | |
| 242 | Q.PRINT | TODO ---- printing ---- The integer part, a point, five digits, a blank; always in decimal. | |
| 243 | Q.SCALE | TODO | |
| 244 | Q.SIN | TODO | |
| 245 | Q.SQRT | TODO ---- square root ---- | |
| 246 | Q.TO-INT | TODO | |
| 247 | QUERY | ( -- ) | TODO FORTH-79: up to 80 characters, or a line, into TIB; >IN to 0. |
| 248 | QUIT | TODO | |
| 249 | R> | TODO | |
| 250 | R@ | TODO | |
| 251 | REPEAT | TODO | |
| 252 | ROLL | ( n -- ) | TODO FORTH-79: the n-th value, not counting n itself, is taken out and put on top. 3 ROLL is ROT, 2 ROLL is SWAP, 1 ROLL does nothing. n less than one is an error. |
| 253 | ROT | TODO | |
| 254 | ROUTE | ( node port -- ) | TODO the port, by its number, leads toward that node |
| 255 | RSHIFT | TODO | |
| 256 | S>D | TODO | |
| 257 | SAVE-BUFFERS | TODO FORTH-79: write every block that has been UPDATEd. | |
| 258 | SCAN | TODO | |
| 259 | SCR | TODO | |
| 260 | SEARCH | TODO | |
| 261 | SEND | ( baddr u node -- ) | TODO send the node u characters of text to interpret, by the way this node knows to it. What it prints there goes to that node's console. With no way to the node it is error 12. |
| 262 | SEND-ON | ( baddr u node port -- ) | TODO the same by a port this node names, by its number, whatever ways it knows: for a neighbour that has no number of its own yet, to which text is sent as to node 0. |
| 263 | SIGN | TODO | |
| 264 | SKIP | TODO | |
| 265 | SMUDGE | TODO | |
| 266 | SOURCE | ( -- baddr u ) | TODO the input buffer and how much of it is in use |
| 267 | SPACE | TODO | |
| 268 | SPACES | TODO ---- spaces and the number base ---- | |
| 269 | SPAN | TODO | |
| 270 | STATE | TODO | |
| 271 | SWAP | TODO | |
| 272 | THEN | TODO | |
| 273 | THRU | ( first last -- ) | TODO as v3: LOAD each block from first to last. |
| 274 | TIB | TODO | |
| 275 | TRAVERSE | ( baddr n -- baddr' ) | TODO as v3: for n > 0, from a name's count byte to the byte after its last character; otherwise the address unchanged. |
| 276 | TRUE | TODO | |
| 277 | TYPE | TODO | |
| 278 | U* | TODO | |
| 279 | U. | TODO | |
| 280 | U.R | TODO | |
| 281 | U/MOD | TODO | |
| 282 | U< | TODO | |
| 283 | U> | TODO | |
| 284 | UM* | TODO ---- section 4: multiply ------------------------------------------------ | |
| 285 | UNLOOP | TODO | |
| 286 | UNTIL | TODO | |
| 287 | UPDATE | TODO FORTH-79: mark the block most recently asked for as changed, so that it is written before its buffer is used for another. | |
| 288 | VARIABLE | TODO FORTH-79: CREATE and one cell. The standard leaves its first value to the programme; here it is 0. | |
| 289 | VERSION | ( -- ) | TODO which system this is, and its cell width |
| 290 | VLIST | TODO | |
| 291 | VOCABULARY | TODO | |
| 292 | WARM | ( -- ) | TODO as v3's message, and then ABORT: both stacks emptied, the prompt |
| 293 | WHILE | TODO | |
| 294 | WITHIN | TODO | |
| 295 | WORD | TODO | |
| 296 | WORDS | ( -- ) | TODO the names in the CONTEXT vocabulary, the newest first, a blank after each, a new line whenever one has passed column 64. Hidden entries -- a definition under way -- are not shown. (Q)+0 is the column. |
| 297 | XOR | TODO | |
| 298 | [ | TODO | |
| 299 | ['] | TODO ['] xxx the same inside a definition, whatever STATE is; and [LITERAL], which v3 has as another name for LITERAL. | |
| 300 | [COMPILE] | TODO [COMPILE] xxx FORTH-79: compile xxx even though it is immediate | |
| 301 | [LITERAL] | TODO | |
| 302 | \ | TODO | |
| 303 | ] | TODO |