mirror of
https://github.com/toyoshim/Applerm-II.git
synced 2024-06-06 08:29:28 +00:00
Bug fix: brannch target calculation was still wrong
This commit is contained in:
parent
21b25243d7
commit
51faf4afb1
12
6502.S
12
6502.S
|
@ -404,7 +404,7 @@
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro _bxc reg
|
.macro _bxc reg
|
||||||
adds PC, PC, #1
|
adds PC, PC, #2
|
||||||
movs r0, #\reg
|
movs r0, #\reg
|
||||||
tst SR, r0
|
tst SR, r0
|
||||||
bne 1f
|
bne 1f
|
||||||
|
@ -413,7 +413,7 @@
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro _bxs reg
|
.macro _bxs reg
|
||||||
adds PC, PC, #1
|
adds PC, PC, #2
|
||||||
movs r0, #\reg
|
movs r0, #\reg
|
||||||
tst SR, r0
|
tst SR, r0
|
||||||
beq 1f
|
beq 1f
|
||||||
|
@ -422,7 +422,7 @@
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro _bxx
|
.macro _bxx
|
||||||
mov r0, PC
|
subs r0, PC, #1
|
||||||
_ldb
|
_ldb
|
||||||
sxtb r0, r0
|
sxtb r0, r0
|
||||||
add PC, PC, r0
|
add PC, PC, r0
|
||||||
|
@ -619,10 +619,8 @@
|
||||||
adds PC, PC, #1
|
adds PC, PC, #1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro _t a b
|
.macro _t from to
|
||||||
mov r0, \a
|
mov \to, \from
|
||||||
mov \a, \b
|
|
||||||
mov \b, r0
|
|
||||||
adds PC, PC, #1
|
adds PC, PC, #1
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user