-
Notifications
You must be signed in to change notification settings - Fork 0
/
zmachine-cheatsheet.txt
270 lines (240 loc) · 26.6 KB
/
zmachine-cheatsheet.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
General:
-Source: http://inform-fiction.org/zmachine/standards/z1point1 (also located in doc/). Section references refer to this document.
-Games are stored in "story files". Story files are "images" of interpreter memory.
-When using words, MSB comes first
Memory:
-header from 0x00000 to 0x00040. See below.
-dynamic memory from 0x00000 to static memory start. Can be read and written. (Special rules apply for header, see below)
-static memory from "static memory base" (see header) to 0x0ffff (shorter if story file is smaller). Can be read, but not be written.
-high memory from "high memory base" (see header) to end of story file. Can not be read; accessible indirectly by special instructions.
-High memory and static memory may overlap; high memory and dynamic memory must not overlap.
Addressing:
-byte addresses: obvious
-word addresses: address of first byte (MSB) divided by 2 is given. (This means words must be aligned.)
-packed addresses: depends on version.
V1-3: 2*p
V4-5: 4*p
V6-7: (r_o and s_o are called routine / static string offset; located in header)
routine calls: 4*p + 8*r_o
print_paddr: 4*p + 8*s_o
V8 : 8*p
Header:
A means header address (in hex). For multi-byte fields start and end byte are given.
Bitfields are given by the syntax "aa.b": aa means byte address in header; b means bit. (7=MSBit, 0=LSBit)
V means versions this field is applicable for.
C means this field is only conventional.
Dyn means the game may change this byte / bit.
Int means the interpreter may change this byte / bit.
Rst means the interpreter must set this byte / bit correctly after loading / restore / restart.
A | C | V |Dyn|Int|Rst| Descr
-------+---+-----+---+---+---+-------
00 | | 1+ | | | | Version number. 1 to 6
01 | . | 1+ | . | . | . | Flags 1
.0 | | 5+ | | * | * | Colors available?
.1 | | 3 | | | | Status line type (0=score/turns, 1=hours:mins)
| | 6+ | | * | * | Picture displaying available?
.2 | | 3 | | | | Story file split across two disks?
| | 4+ | | * | * | Boldface available?
.3 | * | 3 | | * | | Tandy bit (triggers some games to be less offensive)
| | 4+ | | * | * | Italic available?
.4 | | 3 | | * | * | Status line not available?
| | 4+ | | * | * | Fixed-space style available?
.5 | | 3 | | * | * | Screen splitting available?
| | 6+ | | * | * | Sound effects available?
.6 | | ??? | | * | * | Is a variable-pitch font the default? (Maybe also valid in higher versions)
.7 | | 4+ | | * | * | Timed keyboard input available?
02-03 | * | 1+ | | | | Release number
04-05 | | 1+ | | | | High memory base (byte address)
06-07 | | 1-5 | | | | Initial value of PC (byte address)
| | 6+ | | | | Main routine location (packed address)
08-09 | | 1+ | | | | Dictionary location (byte address)
0A-0B | | 1+ | | | | Object table location (byte address)
0C-0D | | 1+ | | | | Global variables table location (byte address)
0E-0F | | 1+ | | | | Static memory base (byte address)
10-11 | . | 1+ | . | . | . | Flags 2
.0 | | 1+ | * | * | * | Transcipting on?
.1 | | 3+ | * | | * | Force printing in fixed-pitch font
.2 | | 6+ | * | * | | Screen redraw: Interpreter sets this to request redraw; game clears when it complies.
.3 | | 5+ | | * | * | Game wants to use pictures?
.4 | | 5+ | | * | * | Game wants to use undo opcodes?
.5 | | 5+ | | * | * | Game wants to use a mouse?
.6 | | 5+ | | | | Game wants to use colors?
.7 | | 5+ | | * | * | Game wants to use sound effects?
.8 | | 6+ | | * | * | Game wants to use menus?
.9-F | | 1+ | - | - | - | unused. Note: An interpreter should clear these bits for forward compilance.
12-17 | * | 2 | | | | Serial code (ASCII chars)
| * | 3+ | | | | Serial number: compilation date (ASCII chars in the format YYMMDD)
18-19 | | 2+ | | | | Abbrevations table location (byte address)
1A-1B | | 3+ | | | | File length (divided by 2 in V1-3; by 4 in V4-5; by 8 in 6+) (Note: some version 3 files set this field; some do not)
1C-1D | | 3+ | | | | File checksum (Note: some version 3 files set this field; some do not)
1E | | 4+ | | * | * | Interpreter number
1F | | 4+ | | * | * | Interpreter version
20 | | 4+ | | * | * | Screen height in lines. 255 means infinite.
21 | | 4+ | | * | * | Screen width in characters
22-23 | | 5+ | | * | * | Screen width in units
24-25 | | 5+ | | * | * | Screen height in units
26 | | 5 | | * | * | Font width in units (=width of a '0')
| | 6+ | | * | * | Font height in units
27 | | 5 | | * | * | Font height in units
| | 6+ | | * | * | Font width in units (=width of a '0')
28-29 | | 6-7 | | | | Routines offset (r_o)
2A-2B | | 6-7 | | | | Static strings offset (s_o)
2C | | 5+ | | * | * | Default background color
2D | | 5+ | | * | * | Default foreground color
2E-2F | | 5+ | | | | Terminating characters table location (byte address)
30-31 | | 6+ | | * | | Total width in pixels of text sent to output stream 3
32-33 | | 1+ | | * | * | Standard revision number
34-35 | | 5+ | | | | Alphabet table location (byte address); 0 for default
36-37 | | 5+ | | | | Header extension table location (byte address)
38-3F | * | 6+ | | | | For some games: Player name (0 for shipped story files)
3C-3F | * | n/a | | | | Inform 6 stores compiler version here (ASCII chars)
Header extension table:
Addresses here are word addresses, not byte addresses!
A | C | V |Dyn|Int|Rst| Descr
-------+---+-----+---+---+---+-------
00 | | 5+ | | | | Nubmer of following words in the header extension table
01 | | 5+ | | * | | X coordinate of mouse after click
02 | | 5+ | | * | | Y coordinate of mouse after click
03 | | 5+ | | | | Unicode translation table location (TODO: address type?)
04 | . | 5+ | . | . | . | Flags 3
.0 | | 6+ | | * | * | Game wants to use transparency?
.1-7 | | 1+ | | * | * | unused. Note: An interpreter should clear these bits for forward compilance.
05 | | 5+ | | * | * | True default foreground color
06 | | 5+ | | * | * | True default background color
Text encoding:
TODO (Section 3)
Instruction format / encoding:
Each instruction has an "opcode number", "form" and "operand count".
Each operand has an "operand type".
Each Z-Machine instruction starts with an opcode byte. (The opcode byte is not equal to the opcode number!)
The form is determined by opcode byte bits 7-6:
In the case $$0x (range 0x00-0x7F), the form is "long".
In the case $$10 (range 0x80-0xBF), the form is "short". Exception: 0xBE means "extended" form.
In the case $$11 (range 0xC0-0xFF), the form is "variable".
In extended form, a second opcode byte follows the first one (which is 0xBE).
Opcode number:
Long form: opcode byte bits 4-0
Short form: opcode byte bits 3-0
Extended form: second opcode byte (bits 7-0)
Variable form: opcode byte bits 4-0
Operand counts:
Possible "values" are 0OP, 1OP, 2OP, VAR.
Long form: The operand count is 2OP.
Short form: If opcode byte bits 5-4 are $$00, $$01 or $$10, 1OP; if $$11, 0OP.
Extended form: The operand count is VAR.
Variable form: If opcode byte bit 5 is $$0, 2OP; if $$1, VAR.
The opcode can be determined by the opcode number and operand count using the table below.
Some opcodes are "store opcodes", some "branch opcodes", and some "text opcodes".
These categories are not mutually exclusive: Some opcodes are store and branch opcodes.
Which opcode is which also is listed in the table.
In extended and variable form, a byte containing operand types follows the opcode byte(s).
Some special opcodes (currently only call_vs2 and call_vn2) have two operand type bytes.
Operand type:
Possible "values" are large constant, small constant, variable.
An operand type can be encoded using 2 bits: large constant=$$00, small constant=$$01, variable=$$10.
An operand type can be encoded using 1 bit: small constant=$$0, variable=$$1
$$11 means "omitted".
Long form: 2 operands (as long form always is 2OP);
type of first operand encoded in opcode byte bit 6, second in bit 5.
Short form 0OP: 0 operands.
Short form 1OP: 1 operand; type encoded in opcode byte bits 5-4.
Extended and variable form: 0 to 4 (8 for some opcodes) operands;
type of first operand encoded in bits 7-6 of the (first) operand type byte, second in 5-4 etc.
After the first "omitted" operand, all operands must be "omitted".
For opcodes in variable form with opcode count 2OP, exactly two operands must be "omitted".
TODO This is defined in z1point1 4.5. je is 2OP. So why does z1point1 15 define je for up to four operands?
All operands follow. Large constants are 2 bytes long, small constants and variables 1 byte.
If the opcode is a store opcode, a "store variable" byte follows.
If the opcode is a branch opcode, a "branch offset" byte follows. (The branch offset byte is not equal to the branch offset!)
If bit 7 is $$0, a branch occurs when the condition was false; if $$1, when true.
If bit 6 is $$0, a second branch offset byte follows.
The branch offset is given by concatenating first branch offset byte bits 5-0 with second branch offset byte (bits 7-0).
If bit 6 is $$1, no second branch offset byte follows and the branch offset is given in bits 5-0 of the branch offset byte.
If the opcode is a text opcode, a text (of unlimited length) follows; encoded as described above.
Opcodes by opcode number and operand count:
TODO (Section 14)
Opcodes by value of first instruction byte:
Cell contents:
+--------------+
|nn V FORM OPC|
|TYP1 SBT TYP2|
|mnemonic |
+--------------+
nn is the opcode number (in hex).
FORM is the opcode form (LONG, SHORT, VAR, DVAR)
DVAR means variable form with two operand type bytes (as explained above)
V is the first version in which this opcode exists.
OPC is the operand count (0OP, 1OP, 2OP, VAR)
TYP1/2 is the type of the first/second operand. (LRGC, SMLC, VAR)
For VAR and 0OP, TYP1/2 are left empty. For 1OP, TYP2 is left empty.
S/B/T means whether this opcode is a store / branch / text opcode or not.
Don't confuse opcode form VAR, operand count VAR, and operand type VAR!
For some opcode bytes, the opcode depends on the version. In such cases, version, opcode, and S/B/T are marked as *.
| x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | x8 | x9 | xA | xB | xC | xD | xE | xF |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 - LONG 2OP|01 1 LONG 2OP|02 1 LONG 2OP|03 1 LONG 2OP|04 1 LONG 2OP|05 1 LONG 2OP|06 1 LONG 2OP|07 1 LONG 2OP|08 1 LONG 2OP|09 1 LONG 2OP|0A 1 LONG 2OP|0B 1 LONG 2OP|0C 1 LONG 2OP|0D 1 LONG 2OP|0E 1 LONG 2OP|0F 1 LONG 2OP|
0x|SMLC --- SMLC|SMLC B SMLC|SMLC B SMLC|SMLC B SMLC|SMLC B SMLC|SMLC B SMLC|SMLC B SMLC|SMLC B SMLC|SMLC S SMLC|SMLC S SMLC|SMLC B SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|
|--- |je |jl |jg |dec_chk |inc_chk |jin |test |or |and |test_attr |set_attr |clear_attr |store |insert_obj |loadw |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|10 1 LONG 2OP|11 1 LONG 2OP|12 1 LONG 2OP|13 1 LONG 2OP|14 1 LONG 2OP|15 1 LONG 2OP|16 1 LONG 2OP|17 1 LONG 2OP|18 1 LONG 2OP|19 4 LONG 2OP|1A 5 LONG 2OP|1B 5 LONG 2OP|1C 5 LONG 2OP|1D - LONG 2OP|1E - LONG 2OP|1F - LONG 2OP|
1x|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC S SMLC|SMLC SMLC|SMLC SMLC|SMLC SMLC|SMLC --- SMLC|SMLC --- SMLC|SMLC --- SMLC|
|loadb |get_prop |get_prop_addr |get_next_prop |add |sub |mul |div |mod |call_2s |call_2n |set_colour |throw |--- |--- |--- |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 - LONG 2OP|01 1 LONG 2OP|02 1 LONG 2OP|03 1 LONG 2OP|04 1 LONG 2OP|05 1 LONG 2OP|06 1 LONG 2OP|07 1 LONG 2OP|08 1 LONG 2OP|09 1 LONG 2OP|0A 1 LONG 2OP|0B 1 LONG 2OP|0C 1 LONG 2OP|0D 1 LONG 2OP|0E 1 LONG 2OP|0F 1 LONG 2OP|
2x|SMLC --- VAR|SMLC B VAR|SMLC B VAR|SMLC B VAR|SMLC B VAR|SMLC B VAR|SMLC B VAR|SMLC B VAR|SMLC S VAR|SMLC S VAR|SMLC B VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|
|--- |je |jl |jg |dec_chk |inc_chk |jin |test |or |and |test_attr |set_attr |clear_attr |store |insert_obj |loadw |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|10 1 LONG 2OP|11 1 LONG 2OP|12 1 LONG 2OP|13 1 LONG 2OP|14 1 LONG 2OP|15 1 LONG 2OP|16 1 LONG 2OP|17 1 LONG 2OP|18 1 LONG 2OP|19 4 LONG 2OP|1A 5 LONG 2OP|1B 5 LONG 2OP|1C 5 LONG 2OP|1D - LONG 2OP|1E - LONG 2OP|1F - LONG 2OP|
3x|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC S VAR|SMLC VAR|SMLC VAR|SMLC VAR|SMLC --- VAR|SMLC --- VAR|SMLC --- VAR|
|loadb |get_prop |get_prop_addr |get_next_prop |add |sub |mul |div |mod |call_2s |call_2n |set_colour |throw |--- |--- |--- |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 - LONG 2OP|01 1 LONG 2OP|02 1 LONG 2OP|03 1 LONG 2OP|04 1 LONG 2OP|05 1 LONG 2OP|06 1 LONG 2OP|07 1 LONG 2OP|08 1 LONG 2OP|09 1 LONG 2OP|0A 1 LONG 2OP|0B 1 LONG 2OP|0C 1 LONG 2OP|0D 1 LONG 2OP|0E 1 LONG 2OP|0F 1 LONG 2OP|
4x|VAR --- SMLC|VAR B SMLC|VAR B SMLC|VAR B SMLC|VAR B SMLC|VAR B SMLC|VAR B SMLC|VAR B SMLC|VAR S SMLC|VAR S SMLC|VAR B SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|
|--- |je |jl |jg |dec_chk |inc_chk |jin |test |or |and |test_attr |set_attr |clear_attr |store |insert_obj |loadw |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|10 1 LONG 2OP|11 1 LONG 2OP|12 1 LONG 2OP|13 1 LONG 2OP|14 1 LONG 2OP|15 1 LONG 2OP|16 1 LONG 2OP|17 1 LONG 2OP|18 1 LONG 2OP|19 4 LONG 2OP|1A 5 LONG 2OP|1B 5 LONG 2OP|1C 5 LONG 2OP|1D - LONG 2OP|1E - LONG 2OP|1F - LONG 2OP|
5x|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR S SMLC|VAR SMLC|VAR SMLC|VAR SMLC|VAR --- SMLC|VAR --- SMLC|VAR --- SMLC|
|loadb |get_prop |get_prop_addr |get_next_prop |add |sub |mul |div |mod |call_2s |call_2n |set_colour |throw |--- |--- |--- |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 - LONG 2OP|01 1 LONG 2OP|02 1 LONG 2OP|03 1 LONG 2OP|04 1 LONG 2OP|05 1 LONG 2OP|06 1 LONG 2OP|07 1 LONG 2OP|08 1 LONG 2OP|09 1 LONG 2OP|0A 1 LONG 2OP|0B 1 LONG 2OP|0C 1 LONG 2OP|0D 1 LONG 2OP|0E 1 LONG 2OP|0F 1 LONG 2OP|
6x|VAR --- VAR|VAR B VAR|VAR B VAR|VAR B VAR|VAR B VAR|VAR B VAR|VAR B VAR|VAR B VAR|VAR S VAR|VAR S VAR|VAR B VAR|VAR VAR|VAR VAR|VAR VAR|VAR VAR|VAR VAR|
|--- |je |jl |jg |dec_chk |inc_chk |jin |test |or |and |test_attr |set_attr |clear_attr |store |insert_obj |loadw |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|10 1 LONG 2OP|11 1 LONG 2OP|12 1 LONG 2OP|13 1 LONG 2OP|14 1 LONG 2OP|15 1 LONG 2OP|16 1 LONG 2OP|17 1 LONG 2OP|18 1 LONG 2OP|19 4 LONG 2OP|1A 5 LONG 2OP|1B 5 LONG 2OP|1C 5 LONG 2OP|1D - LONG 2OP|1E - LONG 2OP|1F - LONG 2OP|
7x|VAR VAR|VAR VAR|VAR VAR|VAR VAR|VAR VAR|VAR VAR|VAR VAR|VAR VAR|VAR VAR|VAR S VAR|VAR VAR|VAR VAR|VAR VAR|VAR --- VAR|VAR --- VAR|VAR --- VAR|
|loadb |get_prop |get_prop_addr |get_next_prop |add |sub |mul |div |mod |call_2s |call_2n |set_colour |throw |--- |--- |--- |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 1 SHORT 1OP|01 1 SHORT 1OP|02 1 SHORT 1OP|03 1 SHORT 1OP|04 1 SHORT 1OP|05 1 SHORT 1OP|06 1 SHORT 1OP|07 1 SHORT 1OP|08 4 SHORT 1OP|09 1 SHORT 1OP|0A 1 SHORT 1OP|0B 1 SHORT 1OP|0C 1 SHORT 1OP|0D 1 SHORT 1OP|0E 1 SHORT 1OP|0F * SHORT 1OP|
8x|LRGC B |LRGC SB |LRGC SB |LRGC S |LRGC S |LRGC |LRGC |LRGC |LRGC S |LRGC |LRGC |LRGC |LRGC |LRGC |LRGC S |LRGC *** |
|jz |get_sibling |get_child |get_parent |get_prop_len |inc |dec |print_addr |call_ls |remove_obj |print_obj |ret |jump |print_paddr |load |*** |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 1 SHORT 1OP|01 1 SHORT 1OP|02 1 SHORT 1OP|03 1 SHORT 1OP|04 1 SHORT 1OP|05 1 SHORT 1OP|06 1 SHORT 1OP|07 1 SHORT 1OP|08 4 SHORT 1OP|09 1 SHORT 1OP|0A 1 SHORT 1OP|0B 1 SHORT 1OP|0C 1 SHORT 1OP|0D 1 SHORT 1OP|0E 1 SHORT 1OP|0F * SHORT 1OP|
9x|SMLC B |SMLC SB |SMLC SB |SMLC S |SMLC S |SMLC |SMLC |SMLC |SMLC S |SMLC |SMLC |SMLC |SMLC |SMLC |SMLC S |SMLC *** |
|jz |get_sibling |get_child |get_parent |get_prop_len |inc |dec |print_addr |call_ls |remove_obj |print_obj |ret |jump |print_paddr |load |*** |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 1 SHORT 1OP|01 1 SHORT 1OP|02 1 SHORT 1OP|03 1 SHORT 1OP|04 1 SHORT 1OP|05 1 SHORT 1OP|06 1 SHORT 1OP|07 1 SHORT 1OP|08 4 SHORT 1OP|09 1 SHORT 1OP|0A 1 SHORT 1OP|0B 1 SHORT 1OP|0C 1 SHORT 1OP|0D 1 SHORT 1OP|0E 1 SHORT 1OP|0F * SHORT 1OP|
Ax|VAR B |VAR SB |VAR SB |VAR S |VAR S |VAR |VAR |VAR |VAR S |VAR |VAR |VAR |VAR |VAR |VAR S |VAR *** |
|jz |get_sibling |get_child |get_parent |get_prop_len |inc |dec |print_addr |call_ls |remove_obj |print_obj |ret |jump |print_paddr |load |*** |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 1 SHORT 0OP|01 1 SHORT 0OP|02 1 SHORT 0OP|03 1 SHORT 0OP|04 1 SHORT 0OP|05 * SHORT 0OP|06 * SHORT 0OP|07 1 SHORT 0OP|08 1 SHORT 0OP|09 * SHORT 0OP|0A 1 SHORT 0OP|0B 1 SHORT 0OP|0C * SHORT 0OP|0D 3 SHORT 0OP| 5 EXT VAR|0F 5 SHORT 0OP|
Bx| | | T | T | | *** | *** | | | *** | | | *** | B | | B |
|rtrue |rfalse |print |print_ret |nop |*** |*** |restart |ret_popped |*** |quit |new_line |*** |verify |(extended) |piracy |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 - VAR 2OP|01 1 VAR 2OP|02 1 VAR 2OP|03 1 VAR 2OP|04 1 VAR 2OP|05 1 VAR 2OP|06 1 VAR 2OP|07 1 VAR 2OP|08 1 VAR 2OP|09 1 VAR 2OP|0A 1 VAR 2OP|0B 1 VAR 2OP|0C 1 VAR 2OP|0D 1 VAR 2OP|0E 1 VAR 2OP|0F 1 VAR 2OP|
Cx| --- | B | B | B | B | B | B | B | S | S | B | | | | | |
|--- |je |jl |jg |dec_chk |inc_chk |jin |test |or |and |test_attr |set_attr |clear_attr |store |insert_obj |loadw |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|10 1 VAR 2OP|11 1 VAR 2OP|12 1 VAR 2OP|13 1 VAR 2OP|14 1 VAR 2OP|15 1 VAR 2OP|16 1 VAR 2OP|17 1 VAR 2OP|18 1 VAR 2OP|19 4 VAR 2OP|1A 5 VAR 2OP|1B 5 VAR 2OP|1C 5 VAR 2OP|1D - VAR 2OP|1E - VAR 2OP|1F - VAR 2OP|
Dx| | | | | | | | | | S | | | | --- | --- | --- |
|loadb |get_prop |get_prop_addr |get_next_prop |add |sub |mul |div |mod |call_2s |call_2n |set_colour |throw |--- |--- |--- |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|00 * VAR VAR|01 1 VAR VAR|02 1 VAR VAR|03 1 VAR VAR|04 * VAR VAR|05 1 VAR VAR|06 1 VAR VAR|07 1 VAR VAR|08 1 VAR VAR|09 * VAR VAR|0A 3 VAR VAR|0B 3 VAR VAR|0C 4 DVAR VAR|0D 4 VAR VAR|0E 4 VAR VAR|0F 4 VAR VAR|
Ex| *** | | | | *** | | | S | | *** | | | S | | | |
|*** |storew |storeb |put_prop |*** |print_char |print_num |random |push |*** |split_window |set_window |call_vs2 |erase_window |erase_line |set_cursor |
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+
|10 4 VAR VAR|11 4 VAR VAR|12 4 VAR VAR|13 3 VAR VAR|14 3 VAR VAR|15 5 VAR VAR|16 4 VAR VAR|17 4 VAR VAR|18 5 VAR VAR|19 5 VAR VAR|1A 5 DVAR VAR|1B 5 VAR VAR|1C 5 VAR VAR|1D 5 VAR VAR|1E 5 VAR VAR|1F 5 VAR VAR|
Fx| | | | | | | S | SB | S | | | | | | / B |
|get_cursor |set_text_style|buffer_mode |output_stream |input_stream |sound_effect |read_char |scan_table |not |call_vn |call_vn2 |tokenise |encode_text |copy_table |print_table |check_arg_count|
---+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+--------------+-------------+---------------+
Extended opcodes by value of second instruction byte:
TODO (Section 14)