Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
infocom:table_of_opcodes [2024/08/18 12:48] – created robert | infocom:table_of_opcodes [2024/11/14 21:34] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 6: | Line 6: | ||
| 002 | LESS? int1,int2 |||| PRED | Is int1 less than int2? | | | 002 | LESS? int1,int2 |||| PRED | Is int1 less than int2? | | ||
| 003 | GRTR? int1,int2 |||| PRED | Is int1 greater than int2? | | | 003 | GRTR? int1,int2 |||| PRED | Is int1 greater than int2? | | ||
- | | 004 | IGRTR? var,int |||| PRED | Increments | + | | 004 | DLESS? var,int |||| PRED | Decrements |
- | | 005 | DLESS? var,int |||| PRED | Decrements | + | | 005 | IGRTR? var,int |||| PRED | Increments |
| 006 | IN? obj1,obj2 |||| PRED | Is obj1 contained in obj2? | | | 006 | IN? obj1,obj2 |||| PRED | Is obj1 contained in obj2? | | ||
| 007 | BTST word1,word2 |||| PRED | Is every bit that is on in word2 also on in word1? | | | 007 | BTST word1,word2 |||| PRED | Is every bit that is on in word2 also on in word1? | | ||
Line 13: | Line 13: | ||
| 009 | BAND word1,word2 |||| VAL | Bitwise logical and. | | | 009 | BAND word1,word2 |||| VAL | Bitwise logical and. | | ||
| 010 | FSET? obj,flag |||| PRED | Is this flag number set in obj? | | | 010 | FSET? obj,flag |||| PRED | Is this flag number set in obj? | | ||
- | | 011 | FCLEAR | + | | 011 | FSET obj,flag |||| | Set flag in obj. | |
- | | 012 | - | - | - | - | | | | + | | 012 | FCLEAR obj, |
| 013 | SET var,any |||| | Sets the specified variable to any. | | | 013 | SET var,any |||| | Sets the specified variable to any. | | ||
| 014 | MOVE obj1,obj2 |||| | Put obj1 into obj2. | | | 014 | MOVE obj1,obj2 |||| | Put obj1 into obj2. | | ||
Line 27: | Line 27: | ||
| 023 | DIV int1,int2 |||| VAL | Divides int1 by int2, returning the truncated quotient. | | | 023 | DIV int1,int2 |||| VAL | Divides int1 by int2, returning the truncated quotient. | | ||
| 024 | MOD int1,int2 |||| VAL | Divides int1 by int2, returning the remainder. | | | 024 | MOD int1,int2 |||| VAL | Divides int1 by int2, returning the remainder. | | ||
- | | 025 | - | - | - | - | | | | + | | 025 | - | CALL2 fcn, |
- | | 026 | - | - | - | - | | | | + | | 026 | - | - | ICALL2 routine: |
- | | 027 | - | - | - | - | | | | + | | 027 | - | - | COLOR fore: |
- | | 028 | - | - | - | - | | | | + | | 028 | - | - | THROW any, |
| 029 | - | - | - | - | | | | | 029 | - | - | - | - | | | | ||
| 030 | - | - | - | - | | | | | 030 | - | - | - | - | | | | ||
Line 139: | Line 139: | ||
| 134 | DEC var |||| | Decrements the value of var by one. | | | 134 | DEC var |||| | Decrements the value of var by one. | | ||
| 135 | PRINTB str |||| | Like PRINT, but str here is an ordinary byte pointer. | | | 135 | PRINTB str |||| | Like PRINT, but str here is an ordinary byte pointer. | | ||
- | | 136 | - | - | - | - | | | | + | | 136 | - | CALL1 fcn ||| VAL | Same as CALL, but a 1-op. | |
| 137 | REMOVE obj |||| | MOVEs obj to pseudo-object zero. | | | 137 | REMOVE obj |||| | MOVEs obj to pseudo-object zero. | | ||
| 138 | PRINTD obj |||| | Prints the short description of obj. | | | 138 | PRINTD obj |||| | Prints the short description of obj. | | ||
Line 146: | Line 146: | ||
| 141 | PRINT str |||| | Prints the string pointed to by str times two. The multiplication is necessary because str in this instruction is a word-pointer, | | 141 | PRINT str |||| | Prints the string pointed to by str times two. The multiplication is necessary because str in this instruction is a word-pointer, | ||
| 142 | VALUE var |||| VAL | Returns value of var. | | | 142 | VALUE var |||| VAL | Returns value of var. | | ||
- | | 143 | BCOM word |||| VAL | Bitwise logical complement. | | + | | 143 | BCOM word || ICALL1 routine: |
| 144 | - | - | - | - | | | | | 144 | - | - | - | - | | | | ||
| 145 | - | - | - | - | | | | | 145 | - | - | - | - | | | | ||
Line 189: | Line 189: | ||
| 183 | RESTART |||| | Reinitializes the game and generally acts as if it had just been restarted. | | | 183 | RESTART |||| | Reinitializes the game and generally acts as if it had just been restarted. | | ||
| 184 | RSTACK |||| | Does a " | | 184 | RSTACK |||| | Does a " | ||
- | | 185 | FSTACK |||| | Flushes the top off the stack. | | + | | 185 | FSTACK || CATCH || VAL | ZIP/ |
| 186 | QUIT |||| | The game should die peacefully. | | | 186 | QUIT |||| | The game should die peacefully. | | ||
| 187 | CRLF |||| | Prints an end-of-line sequence (carriage-return/ | | 187 | CRLF |||| | Prints an end-of-line sequence (carriage-return/ | ||
| 188 | USL |||| | Updates the status line now instead of waiting for the next READ. | | | 188 | USL |||| | Updates the status line now instead of waiting for the next READ. | | ||
| 189 | VERIFY |||| PRED | Verifies the correctness of the game program stored on disk by comparing the 16-bit sim of the bytes in the program, from byte 64 to byte PLENGTH*2-1, | | 189 | VERIFY |||| PRED | Verifies the correctness of the game program stored on disk by comparing the 16-bit sim of the bytes in the program, from byte 64 to byte PLENGTH*2-1, | ||
- | | 190 | - | - | - | - | | | | + | | 190 | - | - | EXTOP opcode:int || | Tells interpreter the following opcode is an extended opcode, meaning that the next byte is an opcode from a new set of 256 instructions different from the first " |
+ | | ::: | - | - | EXTOP:256 SAVE start: | ||
+ | | ::: | - | - | EXTOP:257 RESTORE start: | ||
+ | | ::: | - | - | EXTOP:258 SHIFT int,n || VAL | SHIFT performs a 16-bit logical shift on int, shifting it left n bits if n is positive, and right the absolute value of n bits if n is negative. In a logical shift, the sign bit is not propagated on rightward shifts, but rather zeroed. | | ||
+ | | ::: | - | - | EXTOP:259 ASHIFT int,n || VAL | ASHIFT performs a 16-bit arithmetic shift on int, shifting it left n bits if n is positive, and right the absolute value of n bits if n is negative. In an arithmetic shift, the sign bit is propagated on rightward shifts, meaning that a negative number stays negative. | | ||
+ | | ::: | - | - | EXTOP:260 || VAL | Selects a particular font for the currently selected window, and returns the number of the previously selected font. If the new font cannot be selected for some reason, returns 0. The font should be remembered for that window until it is explicitly changed. Font 1 is the ”normal” font for the machine in question, and it is selected initially for both screen windows. The interpreter is responsible for updating the FWRD parameter word whenever the font changes. FONT prints and empties the output buffer. It should be possible to change fonts many times, even during a line or word of output. In ZIP20, in addition to the normal font (1), and the picture font (2), font 3 is the VT100 character graphics set. | | ||
+ | | ::: | - | - | EXTOP:261 DISPLAY picture: | ||
+ | | ::: | - | - | EXTOP:262 PICINF picture: | ||
+ | | ::: | - | - | EXTOP:263 DCLEAR picture: | ||
+ | | ::: | - | - | EXTOP:264 MARGIN left: | ||
+ | | ::: | - | - | EXT:265 ISAVE || VAL | This instruction copies the impure area to a reserved part of RAM where it can be copied back by the IRESTORE command. | | ||
+ | | ::: | - | - | EXT:266 IRESTORE || VAL | This instruction causes the saved copy of the impure area to be copied back to the impure area, and thus is a single level UNDO command. | | ||
+ | | ::: | - | - | - || | | | ||
+ | | ::: | - | - | - || | | | ||
| 191 | - | - | - | - | | | | | 191 | - | - | - | - | | | | ||
^ XOPs ^ ZIP ^ EZIP/LZIP ^ XZIP ^ YZIP ^ Returns ^ Summary ^ | ^ XOPs ^ ZIP ^ EZIP/LZIP ^ XZIP ^ YZIP ^ Returns ^ Summary ^ | ||
| 192 | - | - | - | - | | | | | 192 | - | - | - | - | | | | ||
| 193 | EQUAL? any1, | | 193 | EQUAL? any1, | ||
- | | 194 | - | - | - | - | | | | + | | 194 | LESS? int1, |
- | | 195 | - | - | - | - | | | | + | | 195 | GRTR? int1, |
- | | 196 | - | - | - | - | | | | + | | 196 | IGRTR? var, |
- | | 197 | - | - | - | - | | | | + | | 197 | DLESS? var, |
- | | 198 | - | - | - | - | | | | + | | 198 | IN? obj1, |
- | | 199 | - | - | - | - | | | | + | | 199 | BTST word1, |
- | | 200 | - | - | - | - | | | | + | | 200 | BOR word1, |
- | | 201 | - | - | - | - | | | | + | | 201 | BAND word1, |
- | | 202 | - | - | - | - | | | | + | | 202 | FSET? obj, |
- | | 203 | - | - | - | - | | | | + | | 203 | FSET obj, |
- | | 204 | - | - | - | - | | | | + | | 204 | FCLEAR obj, |
- | | 205 | - | - | - | - | | | | + | | 205 | SET var, |
- | | 206 | - | - | - | - | | | | + | | 206 | MOVE obj1, |
- | | 207 | - | - | - | - | | | | + | | 207 | GET table, |
- | | 208 | - | - | - | - | | | | + | | 208 | GETB table, |
- | | 209 | - | - | - | - | | | | + | | 209 | GETP obj, |
- | | 210 | - | - | - | - | | | | + | | 210 | GETPT obj, |
- | | 211 | - | - | - | - | | | | + | | 211 | NEXTP obj, |
- | | 212 | - | - | - | - | | | | + | | 212 | ADD int1, |
- | | 213 | - | - | - | - | | | | + | | 213 | SUB int1, |
- | | 214 | - | - | - | - | | | | + | | 214 | MUL int1, |
- | | 215 | - | - | - | - | | | | + | | 215 | DIV int1, |
- | | 216 | - | - | - | - | | | | + | | 216 | MOD int1, |
| 217 | - | - | - | - | | | | | 217 | - | - | - | - | | | | ||
| 218 | - | - | - | - | | | | | 218 | - | - | - | - | | | | ||
Line 229: | Line 242: | ||
| 222 | - | - | - | - | | | | | 222 | - | - | - | - | | | | ||
| 223 | - | - | - | - | | | | | 223 | - | - | - | - | | | | ||
- | | 224 | - | - | - | - | | | | + | | 224 | - | CALL fcn{, |
| 225 | PUT table, | | 225 | PUT table, | ||
| 226 | PUTB table, | | 226 | PUTB table, | ||
| 227 | PUTP obj, | | 227 | PUTP obj, | ||
- | | 228 | READ table1, | + | | 228 | READ table1, |
| 229 | PRINTC int |||| | Prints the character whose ASCII value is int. | | | 229 | PRINTC int |||| | Prints the character whose ASCII value is int. | | ||
| 230 | PRINTN int |||| | Print int as a signed number. | | | 230 | PRINTN int |||| | Print int as a signed number. | | ||
Line 241: | Line 254: | ||
| 234 | SPLIT int |||| | If option bit 5 in the mode byte is zero, this operation is ignored otherwise it divides the screen into two windows: #1 occupies int lines, preferably at the top of the screen, and #0 occupies the remainder of the screen. If int is zero, this operation restores the normal screen format. Window #1 is special in that it never scrolls if the program outputs characters beyond the right-hand margin, they are not displayed. | | | 234 | SPLIT int |||| | If option bit 5 in the mode byte is zero, this operation is ignored otherwise it divides the screen into two windows: #1 occupies int lines, preferably at the top of the screen, and #0 occupies the remainder of the screen. If int is zero, this operation restores the normal screen format. Window #1 is special in that it never scrolls if the program outputs characters beyond the right-hand margin, they are not displayed. | | ||
| 235 | SCREEN int |||| | If option bit 5 in the mode byte is zero, this operation is ignored otherwise it causes subsequent screen output to fall into window #int. If int is 1, the output cursor is moved to the upper left-hand corner. If int is 0, the output cursor is restored to its previous position. This operation is ignored if the screen is not split, or if int is not zero or one. | | | 235 | SCREEN int |||| | If option bit 5 in the mode byte is zero, this operation is ignored otherwise it causes subsequent screen output to fall into window #int. If int is 1, the output cursor is moved to the upper left-hand corner. If int is 0, the output cursor is restored to its previous position. This operation is ignored if the screen is not split, or if int is not zero or one. | | ||
- | | 236 | - | - | - | - | | | | + | | 236 | - | XCALL fcn,any1-4{, |
- | | 237 | - | - | - | - | | | | + | | 237 | - | CLEAR int ||| | If option bit 0 in the mode byte is zero, this operation is ignored. If int is 1 or 0, it clears window #int. If int is -1, it unsplits the screen (if it has been split) and clears the entire screen. Other values for int are ignored. |
- | | 238 | - | - | - | - | | | | + | | 238 | - | ERASE int ||| | If option bit 4 in the mode byte is zero, this operation is ignored. Otherwise it erases the line on which the cursor lies, according to int. If int is 1, it erases from the curser to the end of the line. There are no other legal values for int at the present time. | |
- | | 239 | - | - | - | - | | | | + | | 239 | - | CURSET int1, |
- | | 240 | - | - | - | - | | | | + | | 240 | - | CURGET |
- | | 241 | - | - | - | - | | | | + | | 241 | - | HLIGHT int ||| | If the appropriate option bit in the mode byte is zero, this operation is ignored. Otherwise, it is interpreted as follows: 0 - no highlight, 1 - inverse video, 2 - bold, 4 - underline or italic at the interpreter' |
- | | 242 | - | - | - | - | | | | + | | 242 | - | BUFOUT int ||| | Determines whether or not output is line-buffered. If int is 1 (the normal case), output is buffered a line at a time so the line breaks can be planned for. If int is 0, all currently buffered output is sent to the screen, and all future output is sent to the screen as it is generated. Note: Output redirected to a TABLE (see next instruction) is not buffered. Disabling buffered output MUST be perfect prior to using the CURSET opcode. Also note: the "line position" |
- | | 243 | - | - | - | - | | | | + | | 243 | - | DIROUT int{, |
- | | 244 | - | - | - | - | | | | + | | 244 | - | DIRIN int{, |
- | | 245 | - | - | - | - | | | | + | | 245 | - | SOUND int | SOUND id: |
- | | 246 | - | - | - | - | | | | + | | 246 | - | INPUT int1{, |
- | | 247 | - | - | - | - | | | | + | | 247 | - | INTBL? any, |
- | | 248 | - | - | - | - | | | | + | | 248 | - | - | BCOM word || VAL | Bitwise logical complement. Note that in XZIP COM is a different opcode. |
- | | 249 | - | - | - | - | | | | + | | 249 | - | - | ICALL routine: |
- | | 250 | - | - | - | - | | | | + | | 250 | - | - | IXCALL routine: |
- | | 251 | - | - | - | - | | | | + | | 251 | - | - | LEX inbuf: |
- | | 252 | - | - | - | - | | | | + | | 252 | - | - | ZWSTR inbuf: |
- | | 253 | - | - | - | - | | | | + | | 253 | - | - | COPYT source: |
- | | 254 | - | - | - | - | | | | + | | 254 | - | - | PRINTT bytes: |
- | | 255 | - | - | - | - | | | | + | | 255 | - | - | ASSIGNED? opt: |
Return to [[: | Return to [[: | ||
+ |