Skip to content

Commit

Permalink
Refactor PSW_BANK
Browse files Browse the repository at this point in the history
  • Loading branch information
steveschnepp committed Sep 10, 2022
1 parent 9178d1c commit 7f422ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions opcodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
#define OPCODE CODEMEM(PC + 0)
#define OPERAND1 CODEMEM(PC + 1)
#define OPERAND2 CODEMEM(PC + 2)
#define INDIR_RX_ADDRESS (aCPU->mLowerData[(OPCODE & 1) + 8 * ((PSW & (PSWMASK_RS0|PSWMASK_RS1))>>PSW_RS0)])
#define RX_ADDRESS ((OPCODE & 7) + 8 * ((PSW & (PSWMASK_RS0|PSWMASK_RS1))>>PSW_RS0))
#define PSW_BANK ((PSW & (PSWMASK_RS0|PSWMASK_RS1))>>PSW_RS0)
#define INDIR_RX_ADDRESS (aCPU->mLowerData[(OPCODE & 1) + 8 * PSW_BANK])
#define RX_ADDRESS ((OPCODE & 7) + 8 * PSW_BANK)
#define CARRY ((PSW & PSWMASK_C) >> PSW_C)

static uint8_t read_mem(struct em8051 *aCPU, uint8_t aAddress)
Expand Down

0 comments on commit 7f422ef

Please sign in to comment.