(instruction uint16, inputRegisters [4]uint16, expectedIAR uint16, t *testing.T)
| 328 | } |
| 329 | |
| 330 | func testJMPR(instruction uint16, inputRegisters [4]uint16, expectedIAR uint16, t *testing.T) { |
| 331 | c := SetUpCPU() |
| 332 | var insAddr uint16 = 0x0000 |
| 333 | |
| 334 | // JMPR |
| 335 | setMemoryLocation(c, insAddr, instruction) |
| 336 | |
| 337 | c.SetIAR(insAddr) |
| 338 | |
| 339 | setRegisters(c, inputRegisters) |
| 340 | |
| 341 | doFetchDecodeExecute(c) |
| 342 | |
| 343 | // registers shouldn't change |
| 344 | checkRegisters(c, inputRegisters[0], inputRegisters[1], inputRegisters[2], inputRegisters[3], t) |
| 345 | |
| 346 | // check IAR has jumped to the new location |
| 347 | checkIAR(c, expectedIAR, t) |
| 348 | } |
| 349 | |
| 350 | func TestJMP(t *testing.T) { |
| 351 | ClearMem() |
no test coverage detected