mirror of
https://github.com/rkujawa/rk65c02.git
synced 2025-01-10 18:29:53 +00:00
BIT instruction does not affect overflow flag in immediate mode.
This commit is contained in:
parent
ac48e5435f
commit
272c4d0b7b
@ -192,10 +192,12 @@ emul_bit(rk65c02emu_t *e, void *id, instruction_t *i)
|
|||||||
else
|
else
|
||||||
e->regs.P |= P_ZERO;
|
e->regs.P |= P_ZERO;
|
||||||
|
|
||||||
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6))
|
if ( ((instrdef_t *)id)->mode != IMMEDIATE) {
|
||||||
e->regs.P |= P_SIGN_OVERFLOW;
|
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6))
|
||||||
else
|
e->regs.P |= P_SIGN_OVERFLOW;
|
||||||
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))
|
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 7))
|
||||||
e->regs.P |= P_NEGATIVE;
|
e->regs.P |= P_NEGATIVE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user