1
0
mirror of https://github.com/rkujawa/rk65c02.git synced 2024-12-13 01:29:57 +00:00

Implement status flags for LDA emulation.

This commit is contained in:
Radosław Kujawa 2017-01-20 09:11:34 +01:00
parent bcedb50e48
commit 14233cf3ca
2 changed files with 10 additions and 2 deletions

View File

@ -10,10 +10,16 @@ emul_lda(rk65c02emu_t *e, instruction_t *i)
e->regs.A = instruction_data_read_1(e, &id, i); e->regs.A = instruction_data_read_1(e, &id, i);
/* adjust status flags */ /* adjust status flags */
if (e->regs.A & NEGATIVE)
e->regs.P |= P_NEGATIVE;
else
e->regs.P &= ~P_NEGATIVE;
if (e->regs.A == 0)
e->regs.P |= P_ZERO;
else
e->regs.P &= ~P_ZERO;
} }
void void

View File

@ -28,6 +28,8 @@ struct reg_state {
#define P_SIGN_OVERFLOW 0x40 #define P_SIGN_OVERFLOW 0x40
#define P_NEGATIVE 0x80 #define P_NEGATIVE 0x80
#define NEGATIVE P_NEGATIVE
typedef struct reg_state reg_state_t; typedef struct reg_state reg_state_t;
struct rk65c02emu { struct rk65c02emu {