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

Function TestJMPCAE

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

Source from the content-addressed store, hash-verified

474}
475
476func TestJMPCAE(t *testing.T) {
477 ClearMem()
478 // Jump if Carry OR A is Larger OR A = B
479
480 // carry condition
481 testJMPConditional(0x005E, 0x0090, 0x0081, [4]uint16{0x0004, 0xFFFF, 0x0001, 0x002}, 0x0090, t)
482
483 // a larger
484 testJMPConditional(0x005E, 0x0020, 0x00F1, [4]uint16{0x0002, 0x0001, 0x0001, 0x002}, 0x0020, t)
485
486 // a = b
487 testJMPConditional(0x005E, 0x0020, 0x00F1, [4]uint16{0x0002, 0x0002, 0x0001, 0x002}, 0x0020, t)
488
489 // should not jump in false case
490 testJMPConditional(0x005E, 0x0021, 0x00F1, [4]uint16{0x0001, 0x0003, 0x0001, 0x0001}, 0x0003, t)
491}
492
493func TestJMPCAZ(t *testing.T) {
494 ClearMem()

Callers

nothing calls this directly

Calls 2

ClearMemFunction · 0.85
testJMPConditionalFunction · 0.85

Tested by

no test coverage detected