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

Function testInstruction

cpu/cpu_test.go:808–821  ·  view source on GitHub ↗
(instruction uint16, inputRegisters [4]uint16, expectedOutputRegisters [4]uint16, t *testing.T)

Source from the content-addressed store, hash-verified

806}
807
808func testInstruction(instruction uint16, inputRegisters [4]uint16, expectedOutputRegisters [4]uint16, t *testing.T) {
809 c := SetUpCPU()
810 setMemoryLocation(c, 0x0000, instruction)
811
812 for i, r := range inputRegisters {
813 setRegister(c, i, r)
814 }
815
816 c.SetIAR(0x0000)
817
818 doFetchDecodeExecute(c)
819
820 checkRegisters(c, expectedOutputRegisters[0], expectedOutputRegisters[1], expectedOutputRegisters[2], expectedOutputRegisters[3], t)
821}
822
823func TestALUShiftLeft(t *testing.T) {
824 ClearMem()

Callers 5

TestALUAddFunction · 0.85
TestALUNOTFunction · 0.85
TestALUANDFunction · 0.85
TestALUORFunction · 0.85
TestALUXORFunction · 0.85

Calls 6

SetUpCPUFunction · 0.85
setMemoryLocationFunction · 0.85
setRegisterFunction · 0.85
doFetchDecodeExecuteFunction · 0.85
checkRegistersFunction · 0.85
SetIARMethod · 0.80

Tested by

no test coverage detected