1
0
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:
Bob Andrews 2024-12-15 22:59:39 +01:00 committed by GitHub
commit 11699a4124
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -737,23 +737,29 @@ static unsigned HaveIRQRequest;
/* ROL */
#define ROL(Val) \
Val <<= 1; \
if (GET_CF ()) { \
Val |= 0x01; \
} \
TEST_ZF (Val); \
TEST_SF (Val); \
TEST_CF (Val)
do { \
unsigned ShiftOut = (Val & 0x80); \
Val <<= 1; \
if (GET_CF ()) { \
Val |= 0x01; \
} \
TEST_ZF (Val); \
TEST_SF (Val); \
SET_CF (ShiftOut); \
} while (0)
/* ROR */
#define ROR(Val) \
if (GET_CF ()) { \
Val |= 0x100; \
} \
SET_CF (Val & 0x01); \
Val >>= 1; \
TEST_ZF (Val); \
TEST_SF (Val)
do { \
unsigned ShiftOut = (Val & 0x01); \
Val >>= 1; \
if (GET_CF ()) { \
Val |= 0x80; \
} \
TEST_ZF (Val); \
TEST_SF (Val); \
SET_CF (ShiftOut); \
} while(0)
/* ASL */
#define ASL(Val) \