mirror of
https://github.com/cc65/cc65.git
synced 2024-12-25 17:29:50 +00:00
Merge pull request #2557 from sidneycadot/fix-sim65-rol-ror-ops
sim65 : improve implementation of ROL and ROR operations
This commit is contained in:
commit
11699a4124
@ -737,23 +737,29 @@ static unsigned HaveIRQRequest;
|
||||
|
||||
/* ROL */
|
||||
#define ROL(Val) \
|
||||
do { \
|
||||
unsigned ShiftOut = (Val & 0x80); \
|
||||
Val <<= 1; \
|
||||
if (GET_CF ()) { \
|
||||
Val |= 0x01; \
|
||||
} \
|
||||
TEST_ZF (Val); \
|
||||
TEST_SF (Val); \
|
||||
TEST_CF (Val)
|
||||
SET_CF (ShiftOut); \
|
||||
} while (0)
|
||||
|
||||
/* ROR */
|
||||
#define ROR(Val) \
|
||||
if (GET_CF ()) { \
|
||||
Val |= 0x100; \
|
||||
} \
|
||||
SET_CF (Val & 0x01); \
|
||||
do { \
|
||||
unsigned ShiftOut = (Val & 0x01); \
|
||||
Val >>= 1; \
|
||||
if (GET_CF ()) { \
|
||||
Val |= 0x80; \
|
||||
} \
|
||||
TEST_ZF (Val); \
|
||||
TEST_SF (Val)
|
||||
TEST_SF (Val); \
|
||||
SET_CF (ShiftOut); \
|
||||
} while(0)
|
||||
|
||||
/* ASL */
|
||||
#define ASL(Val) \
|
||||
|
Loading…
Reference in New Issue
Block a user