mirror of
https://github.com/toyoshim/Applerm-II.git
synced 2024-06-06 08:29:28 +00:00
Bug fix: conditions are hard :(
This commit is contained in:
parent
2ad2fa6efb
commit
9098230d7d
23
6502.S
23
6502.S
|
@ -454,26 +454,23 @@
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro _cp reg
|
.macro _cp reg
|
||||||
prn r0
|
|
||||||
prn \reg
|
|
||||||
__cl (FLAG_N | FLAG_Z | FLAG_C)
|
__cl (FLAG_N | FLAG_Z | FLAG_C)
|
||||||
mov r1, \reg
|
mov r1, \reg
|
||||||
|
subs r2, r1, r0
|
||||||
|
sxtb r2, r2
|
||||||
subs r0, r1, r0
|
subs r0, r1, r0
|
||||||
beq 1f
|
bmi 1f
|
||||||
bcc 3f
|
|
||||||
__se FLAG_C
|
__se FLAG_C
|
||||||
b 3f
|
|
||||||
1:
|
1:
|
||||||
bcc 2f
|
sxtb r0, r0
|
||||||
__se FLAG_C
|
movs r0, r0
|
||||||
2:
|
bpl 1f
|
||||||
__se FLAG_Z
|
|
||||||
3:
|
|
||||||
movs r1, #FLAG_N
|
|
||||||
tst r0, r1
|
|
||||||
beq 1f
|
|
||||||
__se FLAG_N
|
__se FLAG_N
|
||||||
|
b 2f
|
||||||
1:
|
1:
|
||||||
|
bne 2f
|
||||||
|
__se FLAG_Z
|
||||||
|
2:
|
||||||
adds PC, PC, #1
|
adds PC, PC, #1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user