2018-10-06 22:52:39 +00:00
|
|
|
#include "pch.h"
|
|
|
|
#include "Board.h"
|
|
|
|
|
|
|
|
// Using examples from 6809 Assembly Language Programming, by Lance A. Leventhal
|
2018-10-06 22:54:33 +00:00
|
|
|
// Just test the basics...
|
2018-10-06 22:52:39 +00:00
|
|
|
|
|
|
|
TEST_CASE("Add Accumulator B to Index Register X Unsigned ", "[ABX]") {
|
|
|
|
|
|
|
|
Board board;
|
|
|
|
board.initialise();
|
|
|
|
auto& cpu = board.CPU();
|
2018-10-06 22:54:33 +00:00
|
|
|
cpu.step(); // Step over the reset
|
2018-10-06 22:52:39 +00:00
|
|
|
|
|
|
|
SECTION("Inherent") {
|
|
|
|
board.poke(0, 0x3a);
|
|
|
|
cpu.B() = 0x84;
|
|
|
|
cpu.X() = 0x1097;
|
|
|
|
cpu.step();
|
|
|
|
REQUIRE(cpu.X() == 0x111b);
|
|
|
|
}
|
|
|
|
}
|