mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-05-12 19:04:58 +00:00
Implementing the REP instruction
This commit is contained in:
@@ -27,4 +27,46 @@ Test(SEP, setsome)
|
||||
pair.second.cpu->SEP(0x0);
|
||||
auto data = pair.second.cpu->_registers.p.flags;
|
||||
cr_assert_eq(data, 0b11110101, "The flag should be 245 but it was %i", data);
|
||||
}
|
||||
|
||||
Test(REP, resetall)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.second.cpu->_isEmulationMode = false;
|
||||
pair.second.wram->_data[0] = 0xFF;
|
||||
pair.second.cpu->REP(0x0);
|
||||
auto data = pair.second.cpu->_registers.p.flags;
|
||||
cr_assert_eq(data, 0x00, "The flag should be 0x00 but it was %x", data);
|
||||
}
|
||||
|
||||
Test(REP, resetsome)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.second.cpu->_isEmulationMode = false;
|
||||
pair.second.wram->_data[0] = 0b01000000;
|
||||
pair.second.cpu->_registers.p.flags = 0b01000000;
|
||||
pair.second.cpu->REP(0x0);
|
||||
auto data = pair.second.cpu->_registers.p.flags;
|
||||
cr_assert_eq(data, 0x0, "The flag should be 0 but it was %x", data);
|
||||
}
|
||||
|
||||
Test(REP, resetallEmulation)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.second.cpu->_isEmulationMode = true;
|
||||
pair.second.wram->_data[0] = 0xFF;
|
||||
pair.second.cpu->REP(0x0);
|
||||
auto data = pair.second.cpu->_registers.p.flags;
|
||||
cr_assert_eq(data, 0b00110000, "The flag should be 0b00110000 but it was %x", data);
|
||||
}
|
||||
|
||||
Test(REP, resetsomeEmulation)
|
||||
{
|
||||
auto pair = Init();
|
||||
pair.second.cpu->_isEmulationMode = true;
|
||||
pair.second.wram->_data[0] = 0b01000001;
|
||||
pair.second.cpu->_registers.p.flags = 0b01000101;
|
||||
pair.second.cpu->REP(0x0);
|
||||
auto data = pair.second.cpu->_registers.p.flags;
|
||||
cr_assert_eq(data, 0b00110100, "The flag should be 0b00110100 but it was %x", data);
|
||||
}
|
||||
Reference in New Issue
Block a user