mirror of
https://github.com/cc65/cc65.git
synced 2024-12-22 12:30:41 +00:00
Merge pull request #2550 from sidneycadot/fix-bit-imm
Fixed behavior of the 65C02 "BIT #imm" instruction in sim65.
This commit is contained in:
commit
c0a4942b5d
@ -824,6 +824,12 @@ static unsigned HaveIRQRequest;
|
||||
SET_OF (Val & 0x40); \
|
||||
SET_ZF ((Val & Regs.AC) == 0)
|
||||
|
||||
/* BITIMM */
|
||||
/* The BIT instruction with immediate mode addressing only sets
|
||||
the zero flag; the sign and overflow flags are not changed. */
|
||||
#define BITIMM(Val) \
|
||||
SET_ZF ((Val & Regs.AC) == 0)
|
||||
|
||||
/* LDA */
|
||||
#define LDA(Val) \
|
||||
Regs.AC = Val; \
|
||||
@ -2250,7 +2256,9 @@ static void OPC_6502_88 (void)
|
||||
static void OPC_65SC02_89 (void)
|
||||
/* Opcode $89: BIT #imm */
|
||||
{
|
||||
ALU_OP_IMM (BIT);
|
||||
/* Note: BIT #imm behaves differently from BIT with other addressing modes,
|
||||
* hence the different 'op' argument to the macro. */
|
||||
ALU_OP_IMM (BITIMM);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user