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

Function TestJMPCAZ

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

Source from the content-addressed store, hash-verified

491}
492
493func TestJMPCAZ(t *testing.T) {
494 ClearMem()
495 // Jump if Carry OR A is Larger OR zero flag
496
497 // carry condition
498 testJMPConditional(0x005D, 0x0090, 0x0081, [4]uint16{0x0004, 0xFFFF, 0x0001, 0x002}, 0x0090, t)
499
500 // a larger
501 testJMPConditional(0x005D, 0x0020, 0x00F1, [4]uint16{0x0002, 0x0001, 0x0001, 0x002}, 0x0020, t)
502
503 // zero flag (using and)
504 testJMPConditional(0x005D, 0x0020, 0x00C1, [4]uint16{0x0001, 0x00FE, 0x0002, 0x0002}, 0x0020, t)
505
506 // should not jump in false case
507 testJMPConditional(0x005D, 0x0021, 0x00F1, [4]uint16{0x0001, 0x0003, 0x0001, 0x0001}, 0x0003, t)
508}
509
510func TestJMPCEZ(t *testing.T) {
511 ClearMem()

Callers

nothing calls this directly

Calls 2

ClearMemFunction · 0.85
testJMPConditionalFunction · 0.85

Tested by

no test coverage detected