(inputA, inputB uint16, t *testing.T)
| 905 | } |
| 906 | |
| 907 | func testMultiply(inputA, inputB uint16, t *testing.T) { |
| 908 | c := SetUpCPU() |
| 909 | |
| 910 | setMemoryLocation(c, 50, 0x0023) // DATA R3 |
| 911 | setMemoryLocation(c, 51, 0x0001) // .. 1 |
| 912 | setMemoryLocation(c, 52, 0x00EA) // XOR R2, R2 |
| 913 | setMemoryLocation(c, 53, 0x0060) // CLF |
| 914 | setMemoryLocation(c, 54, 0x0090) // SHR R0 |
| 915 | setMemoryLocation(c, 55, 0x0058) // JC |
| 916 | setMemoryLocation(c, 56, 59) // ...addr 59 |
| 917 | setMemoryLocation(c, 57, 0x0040) // JMP |
| 918 | setMemoryLocation(c, 58, 61) // ...addr 61 |
| 919 | setMemoryLocation(c, 59, 0x0060) // CLF |
| 920 | setMemoryLocation(c, 60, 0x0086) // ADD R1, R2 |
| 921 | setMemoryLocation(c, 61, 0x0060) // CLF |
| 922 | setMemoryLocation(c, 62, 0x00A5) // SHL R1 |
| 923 | setMemoryLocation(c, 63, 0x00AF) // SHL R3 |
| 924 | setMemoryLocation(c, 64, 0x0058) // JC |
| 925 | setMemoryLocation(c, 65, 68) // ...addr 68 |
| 926 | setMemoryLocation(c, 66, 0x0040) // JMP |
| 927 | setMemoryLocation(c, 67, 53) // ...addr 53 |
| 928 | |
| 929 | setRegisters(c, [4]uint16{inputA, inputB, 0, 0}) |
| 930 | |
| 931 | c.SetIAR(50) |
| 932 | |
| 933 | for { |
| 934 | doFetchDecodeExecute(c) |
| 935 | if c.iar.Value() >= 68 { |
| 936 | break |
| 937 | } |
| 938 | } |
| 939 | |
| 940 | checkRegister(c, 2, inputA*inputB, t) |
| 941 | } |
| 942 | |
| 943 | func TestIOInputInstruction(t *testing.T) { |
| 944 | ClearMem() |
no test coverage detected