Bug fix: adc and sbc performed wrong carry flag calculation

This commit is contained in:
Takashi Toyoshima 2014-12-07 19:01:33 +09:00
parent 86d07009b1
commit 064567f346
1 changed files with 3 additions and 2 deletions

5
6502.S
View File

@ -12,6 +12,7 @@
.extern prn
.macro prn reg
push {r0-r3}
mov r0, \reg
bl prn
pop {r0-r3}
.endm
@ -367,7 +368,7 @@
beq 1f
__se FLAG_N
1:
lsrs r1, r1, #17
lsrs r1, r1, #9
bcc 1f
__se FLAG_C
1:
@ -626,7 +627,7 @@
beq 1f
__se FLAG_N
1:
lsrs r1, r1, #17
lsrs r1, r1, #9
bcs 1f
__se FLAG_C
1: