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

Function TestALUAddWithCarry

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

Source from the content-addressed store, hash-verified

637}
638
639func TestALUAddWithCarry(t *testing.T) {
640 ClearMem()
641 testALUAddWithCarry(
642 0x0080,
643 [4]uint16{0xFFFE, 0x0000, 0x0000, 0x0000},
644 [4]uint16{0x0001, 0x0000, 0x0000, 0x0000},
645 t,
646 )
647
648 testALUAddWithCarry(
649 0x0081,
650 [4]uint16{0xFFFE, 0x0005, 0x0000, 0x0000},
651 [4]uint16{0x0000, 0x0001, 0x0000, 0x0000},
652 t,
653 )
654
655 testALUAddWithCarry(
656 0x0082,
657 [4]uint16{0xFFFE, 0x0000, 0x0005, 0x0000},
658 [4]uint16{0x0000, 0x0000, 0x0001, 0x0000},
659 t,
660 )
661
662 testALUAddWithCarry(
663 0x0083,
664 [4]uint16{0xFFFE, 0x0000, 0x0000, 0x0005},
665 [4]uint16{0x0000, 0x0000, 0x0000, 0x0001},
666 t,
667 )
668}
669
670func testALUAddWithCarry(instruction uint16, inputRegisters, expectedOutputRegisters [4]uint16, t *testing.T) {
671 c := SetUpCPU()

Callers

nothing calls this directly

Calls 2

ClearMemFunction · 0.85
testALUAddWithCarryFunction · 0.85

Tested by

no test coverage detected