LSHIFT corrected (a count out of range is error 9, as DECOMPOSITION.md says, not 0). mkdictionary.py check: covers all 318 live words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
22 KiB
22 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 | ! | ( x addr -- ) | Store x in the cell at addr. |
| 5 | # | ( ud1 -- ud2 ) | Pictured output: divide ud1 by BASE, put the remainder's digit in front of the string being built, leave the quotient. |
| 6 | #> | ( ud -- baddr u ) | End pictured output: drop ud and leave the string built since <#. |
| 7 | #S | ( ud -- 0 0 ) | Pictured output: convert digits with # until the number is zero (at least one digit). |
| 8 | ' | ( -- addr ) | ' xxx: the parameter field address of xxx; compiled as a literal when compiling. |
| 9 | ( | ( -- ) | ( text): a comment, ended by the first ); immediate. |
| 10 | (BITS) | ( -- n ) | The number of bits in a cell, counted at run time (forth79.4th; used by U/MOD). |
| 11 | (CONSOLE) | ( -- addr ) | Variable: the node that what this node prints is sent to, as messages (core.f18). |
| 12 | (LOST) | ( -- addr ) | Variable: a count of the messages this node has dropped -- nowhere to send them, or no room. |
| 13 | (ME) | ( -- addr ) | Variable: this node's number in the mesh. |
| 14 | (NB) | ( -- n ) | Constant: the bits in a cell, (BITS) counted once at load (forth79.4th). |
| 15 | (REFUSED) | ( -- addr ) | Variable: a count of the messages that came back to this node, refused. |
| 16 | (SEAL) | ( -- ) | What is in the dictionary now is the system: COLD returns to it and FORGET will not go below it. |
| 17 | (UD) | ( -- addr ) | Variable: U/MOD's divisor while it divides (forth79.4th). |
| 18 | (WORD-DEFINED) | ( -- addr ) | Variable: the hook told when an entry is made, with the xt its code will be at. |
| 19 | (WORD-FORGOTTEN) | ( -- addr ) | Variable: the hook told when entries are forgotten, with the word address they went from. |
| 20 | * | ( n1 n2 -- n3 ) | Multiply: the low cell of the product. |
| 21 | */ | ( n1 n2 n3 -- n4 ) | n1 times n2 divided by n3, through a double-cell intermediate product. |
| 22 | */MOD | ( n1 n2 n3 -- n4 n5 ) | n1 times n2 divided by n3, through a double product: n4 the remainder, n5 the quotient. |
| 23 | + | ( n1 n2 -- n3 ) | Add. |
| 24 | +! | ( n addr -- ) | Add n to the cell at addr. |
| 25 | +LOOP | ( n -- ) | Compile-only: end a DO loop, adding n to the index; the loop ends when the index crosses the limit. |
| 26 | , | ( x -- ) | Compile x into the next cell of the dictionary. |
| 27 | - | ( n1 n2 -- n3 ) | Subtract: n1 minus n2. |
| 28 | -! | ( n addr -- ) | Subtract n from the cell at addr. |
| 29 | --> | ( -- ) | Go on loading with the next block; only in a block being loaded. |
| 30 | -ROT | ( x1 x2 x3 -- x3 x1 x2 ) | Rotate the top three values the other way from ROT. |
| 31 | -TRAILING | ( baddr u1 -- baddr u2 ) | The string without its trailing blanks. |
| 32 | . | ( n -- ) | Print n in the current BASE, then a blank. |
| 33 | .R | ( n width -- ) | Print n right-justified in a field of width characters. |
| 34 | .S | ( -- ) | Print the stack's depth and every value on it, the stack unchanged. |
| 35 | / | ( n1 n2 -- n3 ) | Divide: the quotient of n1 by n2. Division by zero is error 11. |
| 36 | /MOD | ( n1 n2 -- n3 n4 ) | Divide n1 by n2: n3 the remainder, n4 the quotient. |
| 37 | 0< | ( n -- flag ) | True if n is negative. |
| 38 | 0<> | ( x -- flag ) | True if x is not zero. |
| 39 | 0= | ( x -- flag ) | True if x is zero. |
| 40 | 0> | ( n -- flag ) | True if n is greater than zero. |
| 41 | 1+ | ( n -- n+1 ) | Add one. |
| 42 | 1- | ( n -- n-1 ) | Subtract one. |
| 43 | 2! | ( x1 x2 addr -- ) | Store the cell pair at addr: x2 at addr, x1 in the next cell. |
| 44 | 2* | ( n -- 2n ) | Shift left one bit. |
| 45 | 2+ | ( n -- n+2 ) | Add two. |
| 46 | 2, | ( x1 x2 -- ) | Compile the cell pair into the dictionary. |
| 47 | 2- | ( n -- n-2 ) | Subtract two. |
| 48 | 2/ | ( n -- n/2 ) | Shift right one bit, keeping the sign. |
| 49 | 2>R | ( x1 x2 -- ) ( R: -- x1 x2 ) | Compile-only: move the pair to the return stack. |
| 50 | 2@ | ( addr -- x1 x2 ) | Fetch the cell pair at addr. |
| 51 | 2DROP | ( x1 x2 -- ) | Drop the top pair. |
| 52 | 2DUP | ( x1 x2 -- x1 x2 x1 x2 ) | Copy the top pair. |
| 53 | 2OVER | ( x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2 ) | Copy the second pair to the top. |
| 54 | 2R> | ( -- x1 x2 ) ( R: x1 x2 -- ) | Compile-only: move the pair from the return stack. |
| 55 | 2R@ | ( -- x1 x2 ) ( R: x1 x2 -- x1 x2 ) | Compile-only: copy the pair on the return stack. |
| 56 | 2ROT | ( x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2 ) | Rotate the top three pairs. |
| 57 | 2SWAP | ( x1 x2 x3 x4 -- x3 x4 x1 x2 ) | Exchange the top two pairs. |
| 58 | 79-STANDARD | ( -- ) | Run to be sure a FORTH-79 system is there; it is. |
| 59 | : | ( -- ) | : xxx: start a definition of xxx; it cannot be found until ; ends it. |
| 60 | ; | ( -- ) | Compile-only: end the definition -- compile its return, let it be found, stop compiling. |
| 61 | < | ( n1 n2 -- flag ) | True if n1 is less than n2. |
| 62 | <# | ( -- ) | Begin pictured numeric output. |
| 63 | <= | ( n1 n2 -- flag ) | True if n1 is less than or equal to n2. |
| 64 | <> | ( x1 x2 -- flag ) | True if x1 and x2 differ. |
| 65 | = | ( x1 x2 -- flag ) | True if x1 equals x2. |
| 66 | > | ( n1 n2 -- flag ) | True if n1 is greater than n2. |
| 67 | >= | ( n1 n2 -- flag ) | True if n1 is greater than or equal to n2. |
| 68 | >BODY | ( xt -- addr ) | The parameter field of the word whose execution token is xt. |
| 69 | >IN | ( -- addr ) | Variable: the offset in the input buffer of the next character to read. |
| 70 | >LINK | ( xt -- lfa ) | The link field of the entry whose execution token is xt. |
| 71 | >NAME | ( xt -- nfa ) | The name field of the entry whose execution token is xt. |
| 72 | >R | ( x -- ) ( R: -- x ) | Compile-only: move x to the return stack. |
| 73 | ? | ( addr -- ) | Print the number in the cell at addr. |
| 74 | ?DO | ( limit index -- ) | Compile-only: begin a DO loop that is skipped when limit equals index. |
| 75 | ?DUP | ( x -- x x | 0 ) | Copy x if it is not zero. |
| 76 | ?TERMINAL | ( -- flag ) | True if a key has been pressed and is waiting. |
| 77 | @ | ( addr -- x ) | Fetch the cell at addr. |
| 78 | ABORT | ( -- ) | Empty the data and return stacks, set execution mode, return control to the terminal. |
| 79 | ABS | ( n -- u ) | The absolute value. |
| 80 | ACL-ALLOW! | ( flag xt -- ) | Set the word's allow flag (the word-level ACL); nothing on a pinned word. |
| 81 | ACL-ALLOW@ | ( xt -- flag ) | The word's allow flag. |
| 82 | ACL-HEAT@ | ( xt -- heat ) | How often the word has been used: its heat counter. |
| 83 | ACL-HOOK | ( -- addr ) | Variable: the execution token of the ACL recheck word, or 0 for none. |
| 84 | ACL-INHERIT | ( src dst -- ) | dst takes src's ACL mode; it is not pinned, its TTL is 0. |
| 85 | ACL-INIT-PRIMITIVES | ( -- ) | Set every word in every vocabulary to its starting ACL fields. |
| 86 | ACL-MODE! | ( mode xt -- ) | Set the word's ACL mode; nothing on a pinned word. |
| 87 | ACL-MODE@ | ( xt -- mode ) | The word's ACL mode. |
| 88 | ACL-PIN | ( xt -- ) | Pin the word: its ACL fields can no longer be changed. One-way. |
| 89 | ACL-PINNED? | ( xt -- flag ) | True if the word is pinned. |
| 90 | ACL-TTL! | ( n xt -- ) | Set the word's ACL time-to-live (0 to 65535); nothing on a pinned word. |
| 91 | ACL-TTL@ | ( xt -- n ) | The word's ACL time-to-live. |
| 92 | ACL-WORD-ID | ( xt -- n ) | A number for the word that never changes: its address. |
| 93 | AGAIN | ( -- ) | Compile-only: end a BEGIN loop that repeats for ever. |
| 94 | ALIGN | ( -- ) | Align the dictionary pointer to the next cell. |
| 95 | ALLOT | ( n -- ) | Reserve n cells of dictionary space. |
| 96 | AND | ( x1 x2 -- x3 ) | Bitwise and. |
| 97 | AWAIT | ( node -- how ) | Wait for the node's word on how its text ended: 0 QUIT, 1 completed, otherwise an error. |
| 98 | BASE | ( -- addr ) | Variable: the number base for conversion in and out. |
| 99 | BEGIN | ( -- ) | Compile-only: mark the start of a loop (UNTIL, WHILE ... REPEAT, AGAIN). |
| 100 | BL | ( -- c ) | Constant: the blank character, 32. |
| 101 | BLANK | ( baddr u -- ) | Fill u bytes from baddr with blanks. |
| 102 | BLK | ( -- addr ) | Variable: the block being interpreted, or 0 for the terminal. |
| 103 | BLOCK | ( n -- baddr ) | A buffer holding block n, read from storage if it is not already in one. |
| 104 | BUFFER | ( n -- baddr ) | A buffer assigned to block n, not read from storage. |
| 105 | BYE | ( -- ) | A cold restart of the machine (the kernel's word). |
| 106 | C! | ( c baddr -- ) | Store the byte c at baddr. |
| 107 | C, | ( c -- ) | Compile the byte c into the dictionary. |
| 108 | C@ | ( baddr -- c ) | Fetch the byte at baddr. |
| 109 | CASE | ( -- ) | Compile-only: begin a CASE ... OF ... ENDOF ... ENDCASE selection. |
| 110 | CELLS | ( n1 -- n2 ) | n1 cells, in address units. |
| 111 | CFA | ( pfa -- cfa ) | The code field address from the parameter field address. |
| 112 | CMOVE | ( baddr1 baddr2 u -- ) | Copy u bytes from baddr1 to baddr2, lowest first. |
| 113 | CMOVE> | ( baddr1 baddr2 u -- ) | Copy u bytes from baddr1 to baddr2, highest first (for overlapping moves up). |
| 114 | COLD | ( -- ) | Return the system to what it was when its capsules had just been loaded. |
| 115 | COMPARE | ( baddr1 u1 baddr2 u2 -- n ) | Compare two strings: 0 if equal, -1 if the first is lower, 1 if higher. |
| 116 | COMPILE | ( -- ) | COMPILE xxx: when the word containing this runs, compile xxx. |
| 117 | CONSTANT | ( n -- ) | CONSTANT xxx: define xxx, which leaves n. |
| 118 | CONTEXT | ( -- addr ) | Variable: the vocabulary searched first. |
| 119 | CONVERT | ( d1 baddr1 -- d2 baddr2 ) | Convert the digits from baddr1+1 into d1 in BASE; baddr2 is the first character that is not a digit. |
| 120 | COUNT | ( baddr1 -- baddr2 u ) | From a counted string: its first character's address and its length. |
| 121 | CR | ( -- ) | Print a new line. |
| 122 | CREATE | ( -- ) | CREATE xxx: an entry whose word leaves the address of its parameter field. |
| 123 | CURRENT | ( -- addr ) | Variable: the vocabulary new definitions go into. |
| 124 | D+ | ( d1 d2 -- d3 ) | Add two double-cell numbers. |
| 125 | D- | ( d1 d2 -- d3 ) | Subtract d2 from d1. |
| 126 | D. | ( d -- ) | Print the double-cell number d, then a blank. |
| 127 | D.R | ( d width -- ) | Print d right-justified in a field of width characters. |
| 128 | D0< | ( d -- flag ) | True if d is negative. |
| 129 | D0= | ( d -- flag ) | True if d is zero. |
| 130 | D2* | ( d1 -- d2 ) | Shift d1 left one bit. |
| 131 | D2/ | ( d1 -- d2 ) | Shift d1 right one bit, keeping the sign. |
| 132 | D< | ( d1 d2 -- flag ) | True if d1 is less than d2. |
| 133 | D= | ( d1 d2 -- flag ) | True if d1 equals d2. |
| 134 | DABS | ( d -- ud ) | The absolute value of d. |
| 135 | DECIMAL | ( -- ) | Set BASE to ten. |
| 136 | DEFAULT-ROUTE | ( port -- ) | The port, by its number, leads toward every node this node has not been told of. |
| 137 | DEFER | ( -- ) | DEFER xxx: define xxx, whose action is set later by IS; run unset, it is error 15. |
| 138 | DEFER@ | ( -- xt ) | DEFER@ xxx: the execution token xxx runs now; compiled when compiling. |
| 139 | DEFINITIONS | ( -- ) | New definitions go into the CONTEXT vocabulary from now on. |
| 140 | DEPTH | ( -- n ) | The number of values on the stack before DEPTH. |
| 141 | DMAX | ( d1 d2 -- d3 ) | The greater of two doubles. |
| 142 | DMIN | ( d1 d2 -- d3 ) | The lesser of two doubles. |
| 143 | DNEGATE | ( d -- -d ) | Negate a double-cell number. |
| 144 | DO | ( limit index -- ) | Compile-only: begin a counted loop, ended by LOOP or +LOOP. |
| 145 | DOES> | ( -- ) | Compile-only: in a defining word, what the words it defines do, with their parameter field's address on the stack. |
| 146 | DROP | ( x -- ) | Drop the top value. |
| 147 | DUMP | ( baddr u -- ) | Print u bytes from baddr in the current BASE, with their addresses. |
| 148 | DUP | ( x -- x x ) | Copy the top value. |
| 149 | ELSE | ( -- ) | Compile-only: the other branch of IF ... ELSE ... THEN. |
| 150 | EMIT | ( c -- ) | Print the character c. |
| 151 | EMPTY-BUFFERS | ( -- ) | Forget what is in the block buffers; nothing is written. |
| 152 | ENCLOSE | ( baddr c -- baddr n1 n2 n3 ) | Find a word delimited by c in the string at baddr: n1 its start, n2 its end, n3 the offset after the delimiter. |
| 153 | ENDCASE | ( x -- ) | Compile-only: end a CASE selection, dropping the value if no OF matched. |
| 154 | ENDOF | ( -- ) | Compile-only: end an OF branch; go on after ENDCASE. |
| 155 | ERASE | ( baddr u -- ) | Fill u bytes from baddr with zeros. |
| 156 | EXECUTE | ( xt -- ) | Run the word whose execution token is xt. |
| 157 | EXIT | ( -- ) | Compile-only: return from the definition at this point. |
| 158 | EXPECT | ( baddr n -- ) | Read up to n characters, or a line, from the terminal into baddr; SPAN holds how many. |
| 159 | FALSE | ( -- 0 ) | Constant: the false flag, zero. |
| 160 | FENCE | ( -- addr ) | Variable: FORGET will not remove anything below the address it holds. |
| 161 | FILL | ( baddr u c -- ) | Fill u bytes from baddr with the byte c. |
| 162 | FIND | ( -- xt | 0 ) | FIND xxx: the execution token of xxx, from the input stream, or 0 if it is not found. |
| 163 | FLUSH | ( -- ) | Write every changed block (SAVE-BUFFERS). |
| 164 | FORGET | ( -- ) | FORGET xxx: remove xxx and every word defined after it, never below FENCE. |
| 165 | FORTH | ( -- ) | Make FORTH, the primary vocabulary, the CONTEXT vocabulary. |
| 166 | GONE | ( n node -- ) | Tell the node that node n is gone; it acts on that only if this node is its centre. |
| 167 | HERE | ( -- addr ) | The address of the next free dictionary cell. |
| 168 | HEX | ( -- ) | Set BASE to sixteen. |
| 169 | HIDDEN | ( -- ) | Hide the newest entry: it cannot be found until revealed. |
| 170 | HOLD | ( c -- ) | Pictured output: put the character c in front of the string being built. |
| 171 | I | ( -- n ) | Compile-only: the index of the innermost DO loop. |
| 172 | IF | ( flag -- ) | Compile-only: run what follows if flag is not zero, else skip to ELSE or THEN. |
| 173 | IMMEDIATE | ( -- ) | Make the newest definition run when compiling instead of being compiled. |
| 174 | INTERPRET | ( -- ) | Interpret words from the input stream until it is exhausted. |
| 175 | INVERT | ( x1 -- x2 ) | Invert every bit. |
| 176 | IS | ( xt -- ) | IS xxx: make the deferred word xxx run xt; compiled when compiling. |
| 177 | J | ( -- n ) | Compile-only: the index of the next outer DO loop. |
| 178 | KERNEL-WORD | ( n -- ) | KERNEL-WORD xxx: define xxx, a word that asks the kernel to do request n (as BYE, BLOCK). |
| 179 | KEY | ( -- c ) | Wait for a key and leave its character. |
| 180 | LATEST | ( -- xt ) | The newest entry of the CURRENT vocabulary. |
| 181 | LEAVE | ( -- ) | Compile-only: leave the innermost DO loop at its next LOOP or +LOOP. |
| 182 | LFA | ( xt -- addr ) | The link field of the entry (>LINK). |
| 183 | LINK> | ( addr -- xt ) | The entry that a link field points to. |
| 184 | LIST | ( n -- ) | Print block n as 16 lines of 64 characters; SCR holds n. |
| 185 | LITERAL | ( x -- ) | If compiling, compile x as a literal. |
| 186 | LOAD | ( n -- ) | Interpret block n, then go on with what follows. |
| 187 | LOG-DEBUG | ( -- 4 ) | Constant: the debug log level. |
| 188 | LOG-DEBUG-STR | ( baddr u -- ) | Log the string at the debug level. |
| 189 | LOG-ERROR | ( -- 0 ) | Constant: the error log level. |
| 190 | LOG-ERROR-STR | ( baddr u -- ) | Log the string at the error level. |
| 191 | LOG-INFO | ( -- 2 ) | Constant: the info log level. |
| 192 | LOG-INFO-STR | ( baddr u -- ) | Log the string at the info level. |
| 193 | LOG-LEVEL! | ( n -- ) | Set the log level, held to 0 .. 4: messages at or below it are printed. |
| 194 | LOG-LEVEL@ | ( -- n ) | The log level. |
| 195 | LOG-TEST | ( -- 3 ) | Constant: the test log level. |
| 196 | LOG-TEST-STR | ( baddr u -- ) | Log the string at the test level. |
| 197 | LOG-WARN | ( -- 1 ) | Constant: the warning log level. |
| 198 | LOG-WARN-STR | ( baddr u -- ) | Log the string at the warning level. |
| 199 | LOOP | ( -- ) | Compile-only: end a DO loop, adding one to the index. |
| 200 | LSHIFT | ( x1 u -- x2 ) | Shift x1 left u bits; a count that is negative or a cell wide or more is error 9. |
| 201 | M* | ( n1 n2 -- d ) | Multiply: the double-cell product, signed. |
| 202 | M+ | ( d1 n -- d2 ) | Add a single-cell number to a double. |
| 203 | M- | ( d1 n -- d2 ) | Subtract a single-cell number from a double. |
| 204 | M/MOD | ( d n1 -- n2 n3 ) | Divide d by n1: n2 the remainder, n3 the quotient. |
| 205 | MAX | ( n1 n2 -- n3 ) | The greater of two numbers. |
| 206 | MIN | ( n1 n2 -- n3 ) | The lesser of two numbers. |
| 207 | MINT-ZUSE | ( -- ) | Mint the real Zuse onto a second stick: asks for the stick, writes nothing until YES (the kernel's word; STICK.md 6a). |
| 208 | MOD | ( n1 n2 -- n3 ) | The remainder of n1 divided by n2. |
| 209 | MOVE | ( addr1 addr2 n -- ) | Copy n cells from addr1 to addr2, the first cell first. |
| 210 | NAME> | ( baddr -- xt ) | The entry whose name field is at baddr. |
| 211 | NEGATE | ( n -- -n ) | Negate. |
| 212 | NEIGHBOUR | ( node port -- ) | Record the node on the other end of the port, by its number; 0: none. |
| 213 | NFA | ( xt -- baddr ) | The name field of the entry (>NAME). |
| 214 | NO-ROUTE | ( node -- ) | Forget the way to that node, if one is known. |
| 215 | NO-ROUTES | ( -- ) | Forget every way to every node: for when the wiring has changed. |
| 216 | NODE-ERROR | ( -- addr ) | Variable: storing a non-zero code raises that error -- the word goes no further and the line ends with ERROR. |
| 217 | NOP | ( -- ) | Do nothing. |
| 218 | NOT | ( flag1 -- flag2 ) | True if flag1 is zero (as 0=). |
| 219 | NUMBER | ( baddr -- d ) | Convert the counted string at baddr to a double; what is not a number gives 0 and sets NODE-ERROR. |
| 220 | OCTAL | ( -- ) | Set BASE to eight. |
| 221 | OF | ( x1 x2 -- | x1 ) | Compile-only: in CASE, run the branch to ENDOF if x1 equals x2. |
| 222 | OR | ( x1 x2 -- x3 ) | Bitwise or. |
| 223 | ORDER | ( -- ) | Print where names are looked for, and where new ones go. |
| 224 | OVER | ( x1 x2 -- x1 x2 x1 ) | Copy the second value to the top. |
| 225 | PAD | ( -- baddr ) | A scratch area for text. |
| 226 | PAGE | ( -- ) | Clear the screen and put the cursor at the top. |
| 227 | PFA | ( xt -- addr ) | The parameter field of the entry. |
| 228 | PICK | ( n -- x ) | A copy of the n-th value, not counting n itself: 1 PICK is DUP. |
| 229 | PORT! | ( w port -- ) | Write a cell to the port, by its number; waits until the neighbour reads it. |
| 230 | Q.* | ( q1 q2 -- q3 ) | Multiply two Q48.16 fixed-point numbers. |
| 231 | Q.+ | ( q1 q2 -- q3 ) | Add two Q48.16 numbers (D+). |
| 232 | Q.- | ( q1 q2 -- q3 ) | Subtract q2 from q1 (D-). |
| 233 | Q./ | ( q1 q2 -- q3 ) | Divide q1 by q2; by zero is error 11. |
| 234 | Q.0 | ( -- q ) | The Q48.16 zero, 0 0. |
| 235 | Q.0= | ( q -- flag ) | True if q is zero. |
| 236 | Q.1 | ( -- q ) | The Q48.16 one, 65536 0. |
| 237 | Q.< | ( q1 q2 -- flag ) | True if q1 is less than q2. |
| 238 | Q.= | ( q1 q2 -- flag ) | True if q1 equals q2. |
| 239 | Q.> | ( q1 q2 -- flag ) | True if q1 is greater than q2. |
| 240 | Q.ABS | ( q1 -- q2 ) | The absolute value. |
| 241 | Q.COS | ( q1 -- q2 ) | The cosine of q1, in radians. |
| 242 | Q.EXP | ( q1 -- q2 ) | e to the power q1. |
| 243 | Q.FROM-INT | ( n -- q ) | The integer n as a Q48.16 number. |
| 244 | Q.LOG | ( q1 -- q2 ) | The natural logarithm of q1; not above zero is error 12. |
| 245 | Q.MAX | ( q1 q2 -- q3 ) | The greater of two Q48.16 numbers. |
| 246 | Q.MIN | ( q1 q2 -- q3 ) | The lesser of two Q48.16 numbers. |
| 247 | Q.NEG | ( q1 -- q2 ) | Negate. |
| 248 | Q.PRINT | ( q -- ) | Print q: the integer part, a point, five digits, a blank; always in decimal. |
| 249 | Q.SCALE | ( -- q ) | The scale of the fraction, 65536 0 (1.0). |
| 250 | Q.SIN | ( q1 -- q2 ) | The sine of q1, in radians. |
| 251 | Q.SQRT | ( q1 -- q2 ) | The square root of q1; below zero is error 12. |
| 252 | Q.TO-INT | ( q -- n ) | The integer part of q. |
| 253 | QUERY | ( -- ) | Read up to 80 characters, or a line, from the terminal into TIB; set >IN to 0. |
| 254 | QUIT | ( -- ) | Empty the return stack, set execution mode and go back to the terminal, without a message. |
| 255 | R> | ( -- x ) ( R: x -- ) | Compile-only: move the top of the return stack to the data stack. |
| 256 | R@ | ( -- x ) ( R: x -- x ) | Compile-only: copy the top of the return stack. |
| 257 | REPEAT | ( -- ) | Compile-only: end a BEGIN ... WHILE ... REPEAT loop, jumping back to BEGIN. |
| 258 | ROLL | ( n -- ) | Move the n-th value, not counting n itself, to the top: 2 ROLL is ROT. |
| 259 | ROT | ( x1 x2 x3 -- x2 x3 x1 ) | Rotate the third value to the top. |
| 260 | ROUTE | ( node port -- ) | The port, by its number, leads toward that node. |
| 261 | RSHIFT | ( x1 u -- x2 ) | Shift x1 right u bits, filling with zeros; a count that is negative or a cell wide or more is error 9. |
| 262 | S>D | ( n -- d ) | Extend n to a double-cell number, keeping its sign. |
| 263 | SAVE-BUFFERS | ( -- ) | Write every block that has been UPDATEd. |
| 264 | SCAN | ( baddr u c -- baddr' u' ) | Skip to the first byte c in the string: what is left of it from there. |
| 265 | SCR | ( -- addr ) | Variable: the block most recently LISTed. |
| 266 | SEARCH | ( baddr1 u1 baddr2 u2 -- baddr3 u3 flag ) | Look for the second string in the first: if found, true and the first from there on. |
| 267 | SEND | ( baddr u node -- ) | Send the node u characters of text to interpret, by the way this node knows to it. |
| 268 | SEND-ON | ( baddr u node port -- ) | Send the node text to interpret by the port named, whatever ways are known. |
| 269 | SIGN | ( n -- ) | Pictured output: put a minus sign in front if n is negative. |
| 270 | SKIP | ( baddr u c -- baddr' u' ) | Skip the leading bytes c of the string: what is left of it. |
| 271 | SMUDGE | ( -- ) | Toggle the newest entry's hidden flag. |
| 272 | SOURCE | ( -- baddr u ) | The input buffer and how much of it is in use. |
| 273 | SPACE | ( -- ) | Print a blank. |
| 274 | SPACES | ( n -- ) | Print n blanks. |
| 275 | SPAN | ( -- addr ) | Variable: how many characters the last EXPECT read. |
| 276 | STATE | ( -- addr ) | Variable: not zero while compiling. |
| 277 | SWAP | ( x1 x2 -- x2 x1 ) | Exchange the top two values. |
| 278 | THEN | ( -- ) | Compile-only: end an IF ... THEN or IF ... ELSE ... THEN. |
| 279 | THRU | ( first last -- ) | LOAD each block from first to last. |
| 280 | TIB | ( -- baddr ) | The terminal input buffer. |
| 281 | TRAVERSE | ( baddr n -- baddr' ) | Step across a name field: for n > 0 from its count byte to its last byte, for n < 0 back. |
| 282 | TRUE | ( -- -1 ) | Constant: the true flag, all bits set. |
| 283 | TYPE | ( baddr u -- ) | Print the u characters at baddr. |
| 284 | U* | ( u1 u2 -- ud ) | The unsigned double-cell product (forth79.4th). |
| 285 | U. | ( u -- ) | Print u, unsigned, then a blank. |
| 286 | U.R | ( u width -- ) | Print u, unsigned, right-justified in a field of width characters. |
| 287 | U/MOD | ( ud u1 -- u2 u3 ) | Unsigned divide: u2 the remainder, u3 the quotient; by zero is error 11 (forth79.4th). |
| 288 | U< | ( u1 u2 -- flag ) | True if u1 is less than u2, unsigned. |
| 289 | U> | ( u1 u2 -- flag ) | True if u1 is greater than u2, unsigned. |
| 290 | UM* | ( u1 u2 -- ud ) | Multiply, unsigned: the double-cell product. |
| 291 | UNLOOP | ( -- ) | Compile-only: discard the innermost DO loop's index and limit, before an EXIT from inside it. |
| 292 | UNTIL | ( flag -- ) | Compile-only: end a BEGIN loop, jumping back to BEGIN while flag is zero. |
| 293 | UPDATE | ( -- ) | Mark the block most recently asked for as changed, so it is written. |
| 294 | VARIABLE | ( -- ) | VARIABLE xxx: define xxx, which leaves the address of one cell. |
| 295 | VERSION | ( -- ) | Print which system this is, and its cell width. |
| 296 | VLIST | ( -- ) | List the names in the CONTEXT vocabulary (WORDS). |
| 297 | VOCABULARY | ( -- ) | VOCABULARY xxx: define a vocabulary xxx; running it makes it the CONTEXT vocabulary. |
| 298 | WARM | ( -- ) | Print the system's message and ABORT: both stacks emptied, the prompt. |
| 299 | WHILE | ( flag -- ) | Compile-only: in BEGIN ... WHILE ... REPEAT, leave the loop if flag is zero. |
| 300 | WITHIN | ( n low high -- flag ) | True if low <= n < high. |
| 301 | WORD | ( c -- baddr ) | Read the next word from the input stream, delimited by c, as a counted string. |
| 302 | WORDS | ( -- ) | List the names in the CONTEXT vocabulary, the newest first. |
| 303 | XOR | ( x1 x2 -- x3 ) | Bitwise exclusive or. |
| 304 | [ | ( -- ) | Stop compiling: interpret what follows; immediate. |
| 305 | ['] | ( -- xt ) | Compile-only: ['] xxx compiles xxx's execution token as a literal. |
| 306 | [COMPILE] | ( -- ) | Compile-only: [COMPILE] xxx compiles xxx even though it is immediate. |
| 307 | [LITERAL] | ( x -- ) | Another name for LITERAL, as v3 has it. |
| 308 | \ | ( -- ) | \ text: a comment to the end of the line; immediate. |
| 309 | ] | ( -- ) | Start compiling what follows. |