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

Function TestLD4Times

cpu/cpu_test.go:169–195  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

167}
168
169func TestLD4Times(t *testing.T) {
170 ClearMem()
171 c := SetUpCPU()
172
173 var addr uint16 = 0x00A2
174 values := []uint16{0x0088, 0x0090, 0x0092, 0x00AB}
175
176 for i := uint16(0); i < uint16(len(values)); i++ {
177 setMemoryLocation(c, i, 0x0001)
178 setMemoryLocation(c, addr, values[i])
179 addr++
180 }
181
182 c.SetIAR(0x0000)
183
184 addr = 0x00A2
185 for _, v := range values {
186 setRegister(c, 0, addr)
187 setRegister(c, 1, 0x0001)
188 setRegister(c, 2, 0x0001)
189 setRegister(c, 3, 0x0001)
190
191 doFetchDecodeExecute(c)
192 checkRegisters(c, addr, v, 0x0001, 0x0001, t)
193 addr++
194 }
195}
196
197func TestLD(t *testing.T) {
198 ClearMem()

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected