Inform vs ZIL names for Z-code opcodes

Now and then I want to compare Z-code assembly listings from Inform (or txd) to ZIL code. Then I realize that I don’t have a handy chart to translate one set of opcode names to the other.

So here’s that.

Number   Inform name           ZIL name     ZIL def
1        @je                   EQUAL?       2OP:1
2        @jl                   LESS?        2OP:2
3        @jg                   GRTR?        2OP:3
4        @dec_chk              DLESS?       2OP:4
5        @inc_chk              IGRTR?       2OP:5
6        @jin                  IN?          2OP:6
7        @test                 BTST         2OP:7
8        @or                   BOR          2OP:8
9        @and                  BAND         2OP:9
10       @test_attr            FSET?        2OP:10
11       @set_attr             FSET         2OP:11
12       @clear_attr           FCLEAR       2OP:12
13       @store                SET          2OP:13
14       @insert_obj           MOVE         2OP:14
15       @loadw                GET          2OP:15
16       @loadb                GETB         2OP:16
17       @get_prop             GETP         2OP:17
18       @get_prop_addr        GETPT        2OP:18
19       @get_next_prop        NEXTP        2OP:19
20       @add                  ADD          2OP:20
21       @sub                  SUB          2OP:21
22       @mul                  MUL          2OP:22
23       @div                  DIV          2OP:23
24       @mod                  MOD          2OP:24
25       @call_2s              CALL2        2OP:25
26       @call_2n              ICALL2       2OP:26
27       @set_colour           COLOR        2OP:27
28       @throw                THROW        2OP:28
128      @jz                   ZERO?        1OP:128
129      @get_sibling          NEXT?        1OP:129
130      @get_child            FIRST?       1OP:130
131      @get_parent           LOC          1OP:131
132      @get_prop_len         PTSIZE       1OP:132
133      @inc                  INC          1OP:133
134      @dec                  DEC          1OP:134
135      @print_addr           PRINTB       1OP:135
136      @call_1s              CALL1        1OP:136
137      @remove_obj           REMOVE       1OP:137
138      @print_obj            PRINTD       1OP:138
139      @ret                  RETURN       1OP:139
140      @jump                 JUMP         1OP:140
141      @print_paddr          PRINT        1OP:141
142      @load                 VALUE        1OP:142
143      @call_1n              ICALL1       1OP:143
176      @rtrue                RTRUE        0OP:176
177      @rfalse               RFALSE       0OP:177
178      @print                PRINTI       0OP:178
179      @print_ret            PRINTR       0OP:179
180      @nop                  NOOP         0OP:180
183      @restart              RESTART      0OP:183
184      @ret_popped           RSTACK       0OP:184
185      @catch                CATCH        0OP:185
186      @quit                 QUIT         0OP:186
187      @new_line             CRLF         0OP:187
188      @show_status          USL          0OP:188
189      @verify               VERIFY       0OP:189
191      @piracy               ORIGINAL?    0OP:191
193      @je                   EQUAL?       EXT:193
224      @call_vs              CALL         EXT:224
225      @storew               PUT          EXT:225
226      @storeb               PUTB         EXT:226
227      @put_prop             PUTP         EXT:227
228      @read                 READ         EXT:228
229      @print_char           PRINTC       EXT:229
230      @print_num            PRINTN       EXT:230
231      @random               RANDOM       EXT:231
232      @push                 PUSH         EXT:232
233      @pull                 POP          EXT:233
234      @split_window         SPLIT        EXT:234
235      @set_window           SCREEN       EXT:235
236      @call_vs2             XCALL        EXT:236
237      @erase_window         CLEAR        EXT:237
238      @erase_line           ERASE        EXT:238
239      @set_cursor           CURSET       EXT:239
240      @get_cursor           CURGET       EXT:240
241      @set_text_style       HLIGHT       EXT:241
242      @buffer_mode          BUFOUT       EXP:242
243      @output_stream        DIROUT       EXT:243
244      @input_stream         DIRIN        EXT:244
245      @sound_effect         SOUND        EXT:245
246      @read_char            INPUT        EXT:246
247      @scan_table           INTBL?       EXT:247
248      @not                  BCOM         1OP:248
249      @call_vn              ICALL        EXT:249
250      @call_vn2             IXCALL       EXT:250
251      @tokenise             LEX          EXT:251
252      @encode_text          ZWSTR        EXT:252
253      @copy_table           COPYT        EXT:253
254      @print_table          PRINTT       EXT:254
255      @check_arg_count      ASSIGNED?    EXT:255
EXT:0    @save                 SAVE         EXT:256
EXT:1    @restore              RESTORE      EXT:257
EXT:2    @log_shift            SHIFT        EXT:258
EXT:3    @art_shift            ASHIFT       EXT:259
EXT:4    @set_font             FONT         EXT:260
EXT:5    @draw_picture         DISPLAY      EXT:261
EXT:6    @picture_data         PICINF       EXT:262
EXT:7    @erase_picture        DCLEAR       EXT:263
EXT:8    @set_margins          MARGIN       EXT:264
EXT:9    @save_undo            ISAVE        EXT:265
EXT:10   @restore_undo         IRESTORE     EXT:266
EXT:11   @print_unicode        (zspec-1.0)  
EXT:12   @check_unicode        (zspec-1.0)  
EXT:13   @set_true_colour      (zspec-1.1)  
EXT:16   @move_window          WINPOS       EXT:272
EXT:17   @window_size          WINSIZE      EXT:273
EXT:18   @window_style         WINATTR      EXT:274
EXT:19   @get_wind_prop        WINGET       EXT:275
EXT:20   @scroll_window        SCROLL       EXT:276
EXT:21   @pop_stack            FSTACK       EXT:277
EXT:22   @read_mouse           MOUSE-INFO   EXT:278
EXT:23   @mouse_window         MOUSE-LIMIT  EXT:279
EXT:24   @push_stack           XPUSH        EXT:280
EXT:25   @put_wind_prop        WINPUT       EXT:281
EXT:26   @print_form           PRINTF       EXT:282
EXT:27   @make_menu            MENU         EXT:283
EXT:28   @picture_table        PICSET       EXT:284
EXT:29   @buffer_screen        (zspec-1.1)  


These names are taken from a late (v6) Infocom spec document. A few v3 opcodes were moved or changed in later versions. This table lists the later version and omits the v3-only version.

Four opcodes were added by the modern Z-spec, so they have no ZIL equivalent.

PICSET (@picture_table) is not documented in the Infocom documents that I know of, but it’s used in Shogun and Zork Zero.


FWIW, the Standard 1.0 opcodes do have equivalents in ZILF:

check_unicode -> CHECKU
print_unicode -> PRINTU

Source: Zapf.Parsing/Instructions/Opcodes.cs

1 Like

Noted, thanks.