1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-23 07:30:31 +00:00

BIT instruction does not affect overflow flag in immediate mode.

This commit is contained in:
Radosław Kujawa 2017-02-04 22:07:56 +01:00
parent ac48e5435f
commit 272c4d0b7b

View File

@ -192,10 +192,12 @@ emul_bit(rk65c02emu_t *e, void *id, instruction_t *i)
else
e->regs.P |= P_ZERO;
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6))
e->regs.P |= P_SIGN_OVERFLOW;
else
e->regs.P &= ~P_SIGN_OVERFLOW;
if ( ((instrdef_t *)id)->mode != IMMEDIATE) {
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6))
e->regs.P |= P_SIGN_OVERFLOW;
else
e->regs.P &= ~P_SIGN_OVERFLOW;
}
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 7))
e->regs.P |= P_NEGATIVE;