Implement CB instructions

This commit is contained in:
Michael Smith
2025-08-29 17:42:30 +02:00
parent c18615c629
commit 772ff893af
2 changed files with 33 additions and 0 deletions

View File

@@ -167,3 +167,22 @@ func TestInstruction21(t *testing.T) {
// Should increase the stack pointer
assert.Equal(t, uint16(0x3), cpu.Regs.PC)
}
func TestInstructionCB7E(t *testing.T) {
cpu := createCPU([]byte{0xCB, 0x7E, 0x00, 0x00})
cpu.Regs.H = 0xFF
cpu.Regs.L = 0x40
err := cpu.Bus.Write(0xFF40, 0xFF)
assert.Equal(t, err, nil)
// FIXME(m): This needs bus access to IO, in particular the LCD
// at 0xFF40.
// assert.Equal(t, 0xFF, cpu.Bus.Read(0xFF40))
// cpu.Step()
// // Should set the zero flag
// assert.True(t, cpu.IsFlagSet(Z))
}