tests - Add test for JR e instruction
This commit is contained in:
parent
8160037ffc
commit
cf54c7ec5f
1 changed files with 22 additions and 0 deletions
|
@ -172,3 +172,25 @@ TEST_CASE("CALL ; RET")
|
|||
CHECK(cpu.state.PC == 0x0006);
|
||||
CHECK(cpu.state.SP == 0x0010);
|
||||
}
|
||||
|
||||
TEST_CASE("JR e")
|
||||
{
|
||||
u8 test_ram[] = {
|
||||
0x18, 0x02,
|
||||
0x00, 0x00,
|
||||
0x18, (u8)(-0x06),
|
||||
};
|
||||
|
||||
RAM r(test_ram, 0x6, true);
|
||||
Cpu cpu(&r);
|
||||
|
||||
CHECK(cpu.state.PC == 0x0);
|
||||
|
||||
cpu.step();
|
||||
|
||||
CHECK(cpu.state.PC == 0x4);
|
||||
|
||||
cpu.step();
|
||||
|
||||
CHECK(cpu.state.PC == 0x0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue