Examples > text-adventures COMPANION ZMACHINE.JS (17/28) fetchOperands(types) { const ops = []; for (const t of types) { if (t === 3) break; if (t === 0) { ops.push(this.rw(this.pc)); this.pc += 2; } else if (t === 1) ops.push(this.mem[this.pc++]); else ops.push(this.readVar(this.mem[this.pc++])); } return ops; } typeByte(b) { return [(b >> 6) & 3, (b >> 4) & 3, (b >> 2) & 3, b & 3]; } Next: 39 Companion zmachine.js (18/28)