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

Function testLD

cpu/cpu_test.go:221–235  ·  view source on GitHub ↗
(instruction uint16, memAddress, memValue uint16, inputRegisters, expectedOutputRegisters []uint16, t *testing.T)

Source from the content-addressed store, hash-verified

219}
220
221func testLD(instruction uint16, memAddress, memValue uint16, inputRegisters, expectedOutputRegisters []uint16, t *testing.T) {
222 c := SetUpCPU()
223 var insAddr uint16 = 0x0000
224 setMemoryLocation(c, insAddr, instruction)
225 c.SetIAR(insAddr)
226
227 setMemoryLocation(c, memAddress, memValue)
228
229 for i, v := range inputRegisters {
230 setRegister(c, i, v)
231 }
232
233 doFetchDecodeExecute(c)
234 checkRegisters(c, expectedOutputRegisters[0], expectedOutputRegisters[1], expectedOutputRegisters[2], expectedOutputRegisters[3], t)
235}
236
237func TestST(t *testing.T) {
238 ClearMem()

Callers 1

TestLDFunction · 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