diff --git a/src/mos6502.bits.c b/src/mos6502.bits.c index 66bb4ab..f714bd5 100644 --- a/src/mos6502.bits.c +++ b/src/mos6502.bits.c @@ -54,7 +54,7 @@ DEFINE_INST(bit) // We're just relying on the modify_status function to do negative // and zero; we also need to do overflow, but overflow is checked in // a slightly different way with BIT... - mos6502_modify_status(cpu, MOS_NZ, oper, oper); + mos6502_modify_status(cpu, MOS_NZ, oper, cpu->A & oper); // Normally, overflow is handled by checking if bit 7 flipped from 0 // to 1 or vice versa, and that's done by comparing the result to