This is an old revision of the document!


Table of Opcodes

2OPs ZIP EZIP/LZIP XZIP YZIP Returns Summary
000 - - - -
001 EQUAL? any1,any2 PRED Is any1 equal to any2?
002 LESS? int1,int2 PRED Is int1 less than int2?
003 GRTR? int1,int2 PRED Is int1 greater than int2?
004 IGRTR? var,int PRED Increments the value of var by one and succeeds if the new value is greater than int.
005 DLESS? var,int PRED Decrements the value of var by one and succeeds if the new value is less than int.
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?
008 BOR word1,word2 VAL Bitwise logical or.
009 BAND word1,word2 VAL Bitwise logical and.
010 FSET? obj,flag PRED Is this flag number set in obj?
011 FCLEAR obj,flag Clear flag in obj.
012 - - - -
013 SET var,any Sets the specified variable to any.
014 MOVE obj1,obj2 Put obj1 into obj2.
015 GET table,item VAL Interpreting the table pointed to as a vector of words, returns the item'th element. In other words, returns the word pointed to by item times two plus table. (Tables begin with element zero.)
016 GETB table,item VAL Similar to GET, but assumes a byte table. Returns the byte (converted to a word, of course) pointed to by item plus table.
017 GETP obj,prop VAL Returns specified property of obj. If obj has no property prop, returns prop'th element of default property table.
018 GETPT obj,prop VAL Gets property table prop from obj. Where GETP can only be used with single byte or single word properties, GETPT can be used with properties of any length. It returns a pointer to the property value that may then be used as a table pointer in any other table operation.
019 NEXTP obj,prop VAL Returns the number of the property following prop in obj. Error if no property prop exists in obj. Returns zero if prop is last property. Given proper equal to zero, returns first property (i.e. is circular).
020 ADD int1,int2 VAL Adds the integers.
021 SUB int1,int2 VAL Subtracts int2 from int1.
022 MUL int1,int2 VAL Multiplies the integers.
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.
025 - - - -
026 - - - -
027 - - - -
028 - - - -
029 - - - -
030 - - - -
031 - - - -
032 - - - -
033 - - - -
034 - - - -
035 - - - -
036 - - - -
037 - - - -
038 - - - -
039 - - - -
040 - - - -
041 - - - -
042 - - - -
043 - - - -
044 - - - -
045 - - - -
046 - - - -
047 - - - -
048 - - - -
049 - - - -
050 - - - -
051 - - - -
052 - - - -
053 - - - -
054 - - - -
055 - - - -
056 - - - -
057 - - - -
058 - - - -
059 - - - -
060 - - - -
061 - - - -
062 - - - -
063 - - - -
064 - - - -
065 - - - -
066 - - - -
067 - - - -
068 - - - -
069 - - - -
070 - - - -
071 - - - -
072 - - - -
073 - - - -
074 - - - -
075 - - - -
076 - - - -
077 - - - -
078 - - - -
079 - - - -
080 - - - -
081 - - - -
082 - - - -
083 - - - -
084 - - - -
085 - - - -
086 - - - -
087 - - - -
088 - - - -
089 - - - -
090 - - - -
091 - - - -
092 - - - -
093 - - - -
094 - - - -
095 - - - -
096 - - - -
097 - - - -
098 - - - -
099 - - - -
100 - - - -
101 - - - -
102 - - - -
103 - - - -
104 - - - -
105 - - - -
106 - - - -
107 - - - -
108 - - - -
109 - - - -
110 - - - -
111 - - - -
112 - - - -
113 - - - -
114 - - - -
115 - - - -
116 - - - -
117 - - - -
118 - - - -
119 - - - -
120 - - - -
121 - - - -
122 - - - -
123 - - - -
124 - - - -
125 - - - -
126 - - - -
127 - - - -
1OPs ZIP EZIP/LZIP XZIP YZIP Returns Summary
128 ZERO? any PRED Is any equal to zero?
129 NEXT? obj VAL/PRED Returns “next” slot of obj. Fails if none (equals zero) and returns zero.
130 FIRST? obj VAL/PRED Returns “first” slot of obj. Fails if non (equals zero) and returns zero.
131 LOC obj VAL Return container of obj, zero if none.
132 PTSIZE table VAL Given a property table pointer as may be obtained from GETPT, returns the length of this “table” in bytes. Guaranteed to return a meaningless value if given any other kind of table. (Assumes that the byte preceding the table is a property identifier.)
133 INC var Increments 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.
136 - - - -
137 REMOVE obj MOVEs obj to pseudo-object zero.
138 PRINTD obj Prints the short description of obj.
139 RETURN any Causes the most recently executed CALL to return any and continues execution at the next sequential instruction after that call.
140 JUMP loc An unconditional branch to the location of the next sequential instruction plus loc minus two (for compatibility with predicates). Not that unlike the predicate argument, this is a full twos-complement word.
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, guaranteed to point to a string that has been word-aligned.
142 VALUE var VAL Returns value of var.
143 BCOM word VAL Bitwise logical complement.
144 - - - -
145 - - - -
146 - - - -
147 - - - -
148 - - - -
149 - - - -
150 - - - -
151 - - - -
152 - - - -
153 - - - -
154 - - - -
155 - - - -
156 - - - -
157 - - - -
158 - - - -
159 - - - -
160 - - - -
161 - - - -
162 - - - -
163 - - - -
164 - - - -
165 - - - -
166 - - - -
167 - - - -
168 - - - -
169 - - - -
170 - - - -
171 - - - -
172 - - - -
173 - - - -
174 - - - -
175 - - - -
0OPs ZIP EZIP/LZIP XZIP YZIP Returns Summary
176 RTRUE Does a “RETURN 1,” where 1 is commonly interpreted by Z programs as “true.”
177 RFALSE Does a “RETURN 0,” where 0 is commonly interpreted by Z programs as “false.”
178 PRINTI (str) Prints an immediate string. Interpreted as a 0-operation instruction but immediately followed by a standard string (as opposed to a string-pointer).
179 PRINTR (str) Like PRINTI byut executes a CRLF followed by an RTRUE after printing the string.
180 NOOP No operation, equivalent to a “JUMP 2.”
181 SAVE PRED Writes the “impure” part of the game to disk in some recoverable format. The seed for RANDOM should not be saved or restored so that multiple RESTOREs from the same SAVEd game will not necessarily lead to the same results. Other details of the user interface are left to the discretion of the implementor. Not that this instruction is a predicate.
182 RESTORE PRED Recovers a previously SAVEd game and continues execution aft erthe SAVE. If the RESTORE fails, execution should continue (if possible) after the RESTORE in the original game with the instruction failing.
183 RESTART Reinitializes the game and generally acts as if it had just been restarted.
184 RSTACK Does a “RETURN STACK,” thereby returning from a CALL and taking the value from the (old) top of the stack.
185 FSTACK Flushes the top off the stack.
186 QUIT The game should die peacefully.
187 CRLF Prints an end-of-line sequence (carriage-return/line-feed in ASCII).
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, with PCHKSUM. Not that for the preloaded area, the unmodified pages on the disk should be used rather than the pages in core.
190 - - - -
191 - - - -
XOPs ZIP EZIP/LZIP XZIP YZIP Returns Summary
192 - - - -
193 EQUAL? any1,any2[,any3][,any4] PRED Is any1 equal to any2, any3, or any4?
194 - - - -
195 - - - -
196 - - - -
197 - - - -
198 - - - -
199 - - - -
200 - - - -
201 - - - -
202 - - - -
203 - - - -
204 - - - -
205 - - - -
206 - - - -
207 - - - -
208 - - - -
209 - - - -
210 - - - -
211 - - - -
212 - - - -
213 - - - -
214 - - - -
215 - - - -
216 - - - -
217 - - - -
218 - - - -
219 - - - -
220 - - - -
221 - - - -
222 - - - -
223 - - - -
224 - - - -
225 PUT table,item,any Inverse of GET. Sets the word pointed to to any.
226 PUTB table,item,any PUTB is to GETB as PUT is to GET. Uses only the lower order byte of any. Error if the high-order byte is non-zero.
227 PUTP obj,prop,any Changes value of obj's property prop to any. Error if obj does not have that property.
228 READ table1,table2 Reads and parses a line of input. Rable1 is the buffer used to store the characters read. The first byte (read-only) contains the length of the rest of the buffer where the input string is stored. Table2 stores the results of the parse. The first byte (read-only) of this table specifies the maximum number of words (of text, not machine words) that may be stored here.
229 PRINTC int Prints the character whose ASCII value is int.
230 PRINTN int Print int as a signed number.
231 RANDOM int VAL Returns a random value between 1 and int, inclusive.
232 PUSH any Pushes any onto the stack.
233 POP var Pops the top word off the stack and puts it into var. Note that “POP 'STACK” will have the effect of flushing the next to the top word of the stack.
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.
236 - - - -
237 - - - -
238 - - - -
239 - - - -
240 - - - -
241 - - - -
242 - - - -
243 - - - -
244 - - - -
245 - - - -
246 - - - -
247 - - - -
248 - - - -
249 - - - -
250 - - - -
251 - - - -
252 - - - -
253 - - - -
254 - - - -
255 - - - -

Return to Infocom