mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 15:29:24 +00:00
Add test for CLRA implied
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
9296eaf954
commit
9445e7d1c4
@ -142,3 +142,23 @@ TEST_CASE("Bit Test", "[BIT][BITA]") {
|
||||
REQUIRE(cpu.cycles() == 2);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Clear Accumulator or Memory", "[CLR][CLRA]") {
|
||||
|
||||
Board board;
|
||||
board.initialise();
|
||||
auto& cpu = board.CPU();
|
||||
cpu.step(); // Step over the reset
|
||||
|
||||
SECTION("Implied") {
|
||||
board.poke(0, 0x4f);
|
||||
cpu.A() = 0x43;
|
||||
cpu.step();
|
||||
REQUIRE(cpu.A() == 0x00);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::CF) == 0);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::ZF) != 0);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::NF) == 0);
|
||||
REQUIRE((cpu.CC() & EightBit::mc6809::VF) == 0);
|
||||
REQUIRE(cpu.cycles() == 2);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user