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

Function TestJMPCE

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

Source from the content-addressed store, hash-verified

417}
418
419func TestJMPCE(t *testing.T) {
420 ClearMem()
421 // Jump If Carry or A = B
422 // carry condition
423 testJMPConditional(0x005A, 0x0090, 0x0081, [4]uint16{0x0004, 0xFFFF, 0x0001, 0x002}, 0x0090, t)
424 // a = b
425 testJMPConditional(0x005A, 0x0090, 0x0081, [4]uint16{0x0002, 0x0002, 0x0001, 0x002}, 0x0090, t)
426 // should not jump in false case
427 testJMPConditional(0x005A, 0x0091, 0x0081, [4]uint16{0x0001, 0x0002, 0x0001, 0x0001}, 0x0003, t)
428}
429
430func TestJMPCZ(t *testing.T) {
431 ClearMem()

Callers

nothing calls this directly

Calls 2

ClearMemFunction · 0.85
testJMPConditionalFunction · 0.85

Tested by

no test coverage detected