Bug fix: B and reserved flag should not be modified on updating SR

This commit is contained in:
Takashi Toyoshima 2014-12-08 00:40:40 +09:00
parent 42cb53c0ad
commit 82990fdab7
1 changed files with 3 additions and 0 deletions

3
6502.S
View File

@ -30,6 +30,8 @@
#define FLAG_N (1 << 7)
#define FLAG_V (1 << 6)
#define FLAG_X (1 << 5)
#define FLAG_B (1 << 4)
#define FLAG_D (1 << 3)
#define FLAG_I (1 << 2)
#define FLAG_Z (1 << 1)
@ -927,6 +929,7 @@ op26: // ROR - Zero Page
op28: // PLP
_popb
mov SR, r0
__se (FLAG_X | FLAG_B)
adds PC, PC, #1
_decode