carry and complement instructions

This commit is contained in:
Martin Löffler 2023-01-26 04:23:56 +01:00
parent cb26b0ff77
commit d8cf03afa1
Signed by: FatalErrorCoded
GPG key ID: FFEF368AC076566A

View file

@ -111,6 +111,11 @@ fn tick(state: &mut EmulatorState) {
0x2b => arithmetic::dcx(Register::H, state), 0x2b => arithmetic::dcx(Register::H, state),
0x3b => arithmetic::dcx(Register::SP, state), 0x3b => arithmetic::dcx(Register::SP, state),
0x27 => panic!("Auxiliary Carry not implemented, unable to execute DAA instruction"),
0x2f => state.a = !state.a, // CMA
0x37 => state.cc.c = true, // STC
0x3f => state.cc.c = !state.cc.c, // CMC
0x80..=0x87 => arithmetic::add_reg(register_from_num(instruction & 0xf), false, state), // ADD 0x80..=0x87 => arithmetic::add_reg(register_from_num(instruction & 0xf), false, state), // ADD
0x88..=0x8f => arithmetic::add_reg(register_from_num(instruction & 0xf), state.cc.c, state), // ADC 0x88..=0x8f => arithmetic::add_reg(register_from_num(instruction & 0xf), state.cc.c, state), // ADC
0xc6 => arithmetic::add(next_byte(), false, state), // ADI 0xc6 => arithmetic::add(next_byte(), false, state), // ADI