Z-Machine instruction encoding

In trying to clarify confusion in the Z-Machine Standard, I’ve noticed that the information for encoding instructions contains the following:

Each instruction has a form (long, short, extended or variable) and an operand count (0OP, 1OP, 2OP or VAR)…

In variable form, if bit 5 is 0 then the count is 2OP; if it is 1, then the count is VAR…

The operands are given next. Operand counts of 0OP, 1OP or 2OP require 0, 1 or 2 operands to be given, respectively. If the count is VAR, there must be as many operands as there were types other than ‘omitted’.

This seems to me to say that 2OP opcodes encoded in variable form can still only have two operands, which isn’t true. Am I misreading this? Did I miss something that makes it make sense elsewhere?

I don’t think you missed anything, the Standard just doesn’t explain this very well. It’s doubly misleading because in the table of instructions, je is shown as only taking two operands, but in fact it can take 4 when it’s in VAR form.

Infocom’s ZIP documentation frames it more helpfully.