mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2025-01-10 10:29:43 +00:00
Add test for ADDA immediate. Seems to be working.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
5dc185866e
commit
1f4a84b803
@ -43,3 +43,26 @@ TEST_CASE("Add Memory Plus Carry to Accumulator A", "[ADC][ADCA]") {
|
||||
REQUIRE(cpu.cycles() == 2);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Add Memory to Accumulator A", "[ADD][ADDA]") {
|
||||
|
||||
Board board;
|
||||
board.initialise();
|
||||
auto& cpu = board.CPU();
|
||||
cpu.step(); // Step over the reset
|
||||
|
||||
SECTION("Immediate (byte)") {
|
||||
board.poke(0, 0x8b);
|
||||
board.poke(1, 0x8b);
|
||||
EightBit::Chip::setFlag(cpu.CC(), EightBit::mc6809::CF);
|
||||
cpu.A() = 0x24;
|
||||
cpu.step();
|
||||
REQUIRE(cpu.A() == 0xaf);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::ZF) == 0);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::HF) == 0);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::VF) == 0);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::NF) != 0);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::CF) == 0);
|
||||
REQUIRE(cpu.cycles() == 2);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user