Unused Z-machine opcodes

As I mess with the Dialog compiler, I’ve been poking at the list of opcodes again, and want to check that my understanding is correct. In versions 5, 7, and 8 of the Z-machine, the following opcodes are unused:

  • 0OP opcodes $5, $6, and $C (used for SAVE, RESTORE, and SHOW_STATUS in earlier versions)
  • 2OP opcodes $00 and $1D-$1F
  • EXT opcodes $05-$08 (used for graphics in version 6)
  • EXT opcodes $0E-$0F
  • EXT opcodes $10-$1D (used for windowing in version 6)
  • EXT opcodes $1E-$1F

Is this correct?

As a side note, I’m surprised SET_TRUE_COLOR wasn’t put at 2OP $1D, which would be right near SET_COLOR. It only ever has two operands.

This page confirms what you say: 14. Complete table of opcodes :: The Z-Machine Standards Document

$5 and $6 are illegal after V4, $C is illegal after V3, but is accidentally used in the V5 version of Wishbringer.

Illegal in all versions.

Illegal in everything that isn’t V6.

Reserved for a future standard, so effectively illegal in all versions.

Illegal in everything that isn’t V6.

$1E-$7F are reserved for a future standard, so effectively illegal in all versions.
$80-$FF are reserved for custom opcodes specific to a game/interpreter combo.

1 Like

It can have a third operand in V6.

1 Like