mirror of
https://github.com/mre/mos6502.git
synced 2024-11-30 20:51:21 +00:00
bugfix for the bit opcode
This commit is contained in:
parent
7df9160e32
commit
70e85a2eaf
@ -237,10 +237,10 @@ impl<M: Bus> CPU<M> {
|
|||||||
let is_zero = 0 == res;
|
let is_zero = 0 == res;
|
||||||
|
|
||||||
// The N flag is set to bit 7 of the byte from memory.
|
// The N flag is set to bit 7 of the byte from memory.
|
||||||
let bit7 = 0 != (0x80 & res);
|
let bit7 = 0 != (0x80 & m);
|
||||||
|
|
||||||
// The V flag is set to bit 6 of the byte from memory.
|
// The V flag is set to bit 6 of the byte from memory.
|
||||||
let bit6 = 0 != (0x40 & res);
|
let bit6 = 0 != (0x40 & m);
|
||||||
|
|
||||||
self.registers.status.set_with_mask(
|
self.registers.status.set_with_mask(
|
||||||
Status::PS_ZERO | Status::PS_NEGATIVE | Status::PS_OVERFLOW,
|
Status::PS_ZERO | Status::PS_NEGATIVE | Status::PS_OVERFLOW,
|
||||||
|
Loading…
Reference in New Issue
Block a user