diff options
Diffstat (limited to 'src/vm/instruction.test.js')
-rw-r--r-- | src/vm/instruction.test.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vm/instruction.test.js b/src/vm/instruction.test.js index 82d9819..cf23404 100644 --- a/src/vm/instruction.test.js +++ b/src/vm/instruction.test.js @@ -76,7 +76,7 @@ test('MOV correctly handles indirection', () => { b: { mode: 'immediate', value: 2 }, }); - expect(core.data[pc+1]).toEqual({ + expect(core.data[pc+2]).toEqual({ opcode: 'DAT', a: { mode: 'immediate', value: 0 }, b: { mode: 'immediate', value: 100 }, @@ -93,18 +93,18 @@ test('MOV correctly handles predecrement indirection', () => { core.data[pc] = { opcode: 'MOV', a: { mode: 'immediate', value: 100 }, - b: { mode: 'predecrement', value: -1 }, + b: { mode: 'predecrement', value: 1 }, }; const ins = core.data[pc]; expect(core.data[pc+1].opcode).toBe('DAT'); expect(MOV(core, pc, ins)).toEqual([pc+1]); - expect(core.data[pc-1]).toEqual({ + expect(core.data[pc+1]).toEqual({ opcode: 'DAT', a: { mode: 'immediate', value: 0 }, b: { mode: 'immediate', value: -1 }, }); - expect(core.data[pc-2]).toEqual({ + expect(core.data[pc-1]).toEqual({ opcode: 'DAT', a: { mode: 'immediate', value: 0 }, b: { mode: 'immediate', value: 100 }, @@ -130,7 +130,7 @@ test('MOV correctly handles core boundaries', () => { b: { mode: 'immediate', value: -1 }, }); - expect(core.data[0]).toEqual({ + expect(core.data[CORESIZE-2]).toEqual({ opcode: 'DAT', a: { mode: 'immediate', value: 0 }, b: { mode: 'immediate', value: 100 }, |