| 767 | } |
| 768 | |
| 769 | func TestCMP(t *testing.T) { |
| 770 | ClearMem() |
| 771 | var inputs [4]uint16 = [4]uint16{0xAB92, 0x0091, 0x0045, 0x00AF} |
| 772 | |
| 773 | var instruction uint16 = 0x00F0 |
| 774 | for a := 0; a < 4; a++ { |
| 775 | for b := 0; b < 4; b++ { |
| 776 | testCMP(instruction, inputs, inputs, a, b, t) |
| 777 | instruction++ |
| 778 | } |
| 779 | } |
| 780 | |
| 781 | var zeroes [4]uint16 = [4]uint16{0x0000, 0x0000, 0x0000, 0x0000} |
| 782 | instruction = 0x00F0 |
| 783 | for a := 0; a < 4; a++ { |
| 784 | for b := 0; b < 4; b++ { |
| 785 | testCMP(instruction, zeroes, zeroes, a, b, t) |
| 786 | instruction++ |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | func testCMP(instruction uint16, inputRegisters [4]uint16, expectedOutputRegisters [4]uint16, compareA, compareB int, t *testing.T) { |
| 792 | c := SetUpCPU() |