From f13e7891763305dd36b510104192af734271e1b3 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 9 Jun 2017 09:35:30 +0200 Subject: direct stack access --- eval_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'eval_test.go') diff --git a/eval_test.go b/eval_test.go index 51aeebb..62cd01c 100644 --- a/eval_test.go +++ b/eval_test.go @@ -24,7 +24,7 @@ func TestEval(t *testing.T) { }, { ins: []Instruction{Call(0xff)}, - end: J1{pc: 0xff, rstack: [32]uint16{1}, rsp: 1}, + end: J1{pc: 0xff, rstack: [32]uint16{0x00, 0x01}, rsp: 1}, }, { ins: []Instruction{Lit(0xff)}, @@ -32,15 +32,15 @@ func TestEval(t *testing.T) { }, { ins: []Instruction{Lit(0xff), Lit(0xfe)}, - end: J1{pc: 2, st0: 0xfe, dstack: [32]uint16{0x00, 0xff}, dsp: 2}, + end: J1{pc: 2, st0: 0xfe, dstack: [32]uint16{0x00, 0x00, 0xff}, dsp: 2}, }, { // dup ins: []Instruction{Lit(0xff), ALU{Opcode: 0, TtoN: true, Ddir: 1}}, - end: J1{pc: 2, st0: 0xff, dstack: [32]uint16{0x00, 0xff}, dsp: 2}, + end: J1{pc: 2, st0: 0xff, dstack: [32]uint16{0x00, 0x00, 0xff}, dsp: 2}, }, { // over ins: []Instruction{Lit(0xaa), Lit(0xbb), ALU{Opcode: 1, TtoN: true, Ddir: 1}}, - end: J1{pc: 3, st0: 0xaa, dstack: [32]uint16{0x00, 0xaa, 0xbb}, dsp: 3}, + end: J1{pc: 3, st0: 0xaa, dstack: [32]uint16{0x00, 0x00, 0xaa, 0xbb}, dsp: 3}, }, { // invert ins: []Instruction{Lit(0x00ff), ALU{Opcode: 6}}, @@ -48,23 +48,23 @@ func TestEval(t *testing.T) { }, { // + ins: []Instruction{Lit(1), Lit(2), ALU{Opcode: 2, Ddir: -1}}, - end: J1{pc: 3, st0: 3, dsp: 1, dstack: [32]uint16{0, 1}}, + end: J1{pc: 3, st0: 3, dsp: 1, dstack: [32]uint16{0, 0, 1}}, }, { // swap ins: []Instruction{Lit(2), Lit(3), ALU{Opcode: 1, TtoN: true}}, - end: J1{pc: 3, st0: 2, dsp: 2, dstack: [32]uint16{0, 3}}, + end: J1{pc: 3, st0: 2, dsp: 2, dstack: [32]uint16{0, 0, 3}}, }, { // nip ins: []Instruction{Lit(2), Lit(3), ALU{Opcode: 0, Ddir: -1}}, - end: J1{pc: 3, st0: 3, dsp: 1, dstack: [32]uint16{0, 2}}, + end: J1{pc: 3, st0: 3, dsp: 1, dstack: [32]uint16{0, 0, 2}}, }, { // drop ins: []Instruction{Lit(2), Lit(3), ALU{Opcode: 1, Ddir: -1}}, - end: J1{pc: 3, st0: 2, dsp: 1, dstack: [32]uint16{0, 2}}, + end: J1{pc: 3, st0: 2, dsp: 1, dstack: [32]uint16{0, 0, 2}}, }, { // ; ins: []Instruction{Call(10), Call(20), ALU{Opcode: 0, RtoPC: true, Rdir: -1}}, - end: J1{pc: 11, rsp: 1, rstack: [32]uint16{1, 11}}, + end: J1{pc: 11, rsp: 1, rstack: [32]uint16{0, 1, 11}}, }, { // >r // ins: []Instruction{Lit(10), ALU{Opcode: 1, TtoR: true, Ddir: -1, Rdir: 1}}, -- cgit v1.2.3