        console.log(`pc: ${this.pc} instr: ${instr.toString(16)}`);
        console.log(this.v.map((v, i) => `V${i.toString(16)}: ${v}`).join(' '));

        const i = (instr & 0xF000) >> 12;
        const x = (instr & 0x0F00) >> 8;
        const y = (instr & 0x00F0) >> 4;
        const z = (instr & 0x000F);
        const n = (instr & 0x00FF);
        const a = (instr & 0x0FFF);
        let r = 0; // temp var
        let j = 0; // loop var
        this.pc += 2;

        switch(i) {
          case 0x0:
     