(expectedIAR uint16, t *testing.T)
| 355 | } |
| 356 | |
| 357 | func testJMP(expectedIAR uint16, t *testing.T) { |
| 358 | c := SetUpCPU() |
| 359 | var insAddr uint16 = 0x0000 |
| 360 | |
| 361 | // JMP |
| 362 | setMemoryLocation(c, insAddr, 0x0040) |
| 363 | setMemoryLocation(c, insAddr+1, expectedIAR) |
| 364 | |
| 365 | c.SetIAR(insAddr) |
| 366 | |
| 367 | inputRegisters := [4]uint16{0x0001, 0x0001, 0x0001, 0x0001} |
| 368 | setRegisters(c, inputRegisters) |
| 369 | |
| 370 | doFetchDecodeExecute(c) |
| 371 | |
| 372 | // registers shouldn't change |
| 373 | checkRegisters(c, inputRegisters[0], inputRegisters[1], inputRegisters[2], inputRegisters[3], t) |
| 374 | |
| 375 | // check IAR has jumped to the new location |
| 376 | checkIAR(c, expectedIAR, t) |
| 377 | } |
| 378 | |
| 379 | func TestJMPC(t *testing.T) { |
| 380 | ClearMem() |
no test coverage detected