MCPcopy Create free account
hub / github.com/djhworld/simple-computer / testJMPConditional

Function testJMPConditional

cpu/cpu_test.go:564–582  ·  view source on GitHub ↗
(jmpConditionInstr, destination, initialInstr uint16, inputRegisters [4]uint16, expectedIAR uint16, t *testing.T)

Source from the content-addressed store, hash-verified

562}
563
564func testJMPConditional(jmpConditionInstr, destination, initialInstr uint16, inputRegisters [4]uint16, expectedIAR uint16, t *testing.T) {
565 c := SetUpCPU()
566
567 var insAddr uint16 = 0x0000
568
569 setMemoryLocation(c, insAddr, initialInstr)
570 setMemoryLocation(c, insAddr+1, jmpConditionInstr)
571 setMemoryLocation(c, insAddr+2, destination)
572
573 c.SetIAR(insAddr)
574
575 setRegisters(c, inputRegisters)
576
577 doFetchDecodeExecute(c)
578 doFetchDecodeExecute(c)
579
580 // check IAR
581 checkIAR(c, expectedIAR, t)
582}
583
584func TestCLF(t *testing.T) {
585 ClearMem()

Callers 15

TestJMPCFunction · 0.85
TestJMPAFunction · 0.85
TestJMPEFunction · 0.85
TestJMPZFunction · 0.85
TestJMPCAFunction · 0.85
TestJMPCEFunction · 0.85
TestJMPCZFunction · 0.85
TestJMPAEFunction · 0.85
TestJMPAZFunction · 0.85
TestJMPEZFunction · 0.85
TestJMPCAEFunction · 0.85
TestJMPCAZFunction · 0.85

Calls 6

SetUpCPUFunction · 0.85
setMemoryLocationFunction · 0.85
setRegistersFunction · 0.85
doFetchDecodeExecuteFunction · 0.85
checkIARFunction · 0.85
SetIARMethod · 0.80

Tested by

no test coverage detected