Skip to content

Commit 33eb3ba

Browse files
author
Paul Gardner-Stephen
committed
fix llvm -Oz bug with ldq/stq #70
1 parent f230e1a commit 33eb3ba

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

src/llvm/shres_asm.s

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,24 @@
99
; and processor flags into _shres_regs[4].
1010

1111
_shres_trap:
12-
ldq _shres_regs ; Load 32-bit value from _shres_regs
13-
stq $D645 ; Store to the MEGA65 SYSPART trap address
12+
ldx #3
13+
ll1: lda _shres_regs,x
14+
sta $D645,x
15+
dex
16+
bpl ll1
17+
18+
lda _shres_regs+0
19+
ldx _shres_regs+1
20+
ldy _shres_regs+2
21+
ldz _shres_regs+3
22+
sta $D645 ; Store to the MEGA65 SYSPART trap address
1423
nop ; Delay/stabilize (preserved from original)
1524

16-
stq _shres_regs ; Store result back into _shres_regs
25+
; Store result back into _shres_regs
26+
sta _shres_regs+0
27+
stx _shres_regs+1
28+
sty _shres_regs+2
29+
stz _shres_regs+3
1730

1831
php
1932
pla

0 commit comments

Comments
 (0)