mirror of
https://github.com/pevans/erc-c.git
synced 2025-02-05 04:32:56 +00:00
Also check the N flag (i.e. set it to zero)
This commit is contained in:
parent
e415b3e490
commit
067c0cea2f
@ -97,8 +97,11 @@ DEFINE_INST(lsr)
|
|||||||
{
|
{
|
||||||
SET_RESULT(oper >> 1);
|
SET_RESULT(oper >> 1);
|
||||||
|
|
||||||
// Set ZERO if it should apply
|
// Set ZERO if it should apply; also inspect the NEGATIVE flag, but
|
||||||
mos6502_modify_status(cpu, MOS_ZERO, oper, result);
|
// note that doing so will have the effect of _always_ unsetting the
|
||||||
|
// N flag, because literally any byte value shifted right will
|
||||||
|
// immediately lose the sign bit and be non-negative.
|
||||||
|
mos6502_modify_status(cpu, MOS_NZ, oper, result);
|
||||||
|
|
||||||
// However, we handle carry a bit differently here. The carry bit
|
// However, we handle carry a bit differently here. The carry bit
|
||||||
// should be 1 if oper & 0x1; that is, when we shift right, we want
|
// should be 1 if oper & 0x1; that is, when we shift right, we want
|
||||||
|
Loading…
x
Reference in New Issue
Block a user