aboutsummaryrefslogtreecommitdiffstats
path: root/src/uxn-core.s
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-08-28 20:18:47 +0200
committerBad Diode <bd@badd10de.dev>2023-08-28 20:18:47 +0200
commit9afc23da8cda2dd1380e4282ead882375ea3a5ec (patch)
tree5650fc1486ea5061b176c42a89656cc4802c1a6c /src/uxn-core.s
parentac0bc3913a1a8fdf20d5e3bf3d0631f54ae1fbac (diff)
downloaduxngba-9afc23da8cda2dd1380e4282ead882375ea3a5ec.tar.gz
uxngba-9afc23da8cda2dd1380e4282ead882375ea3a5ec.zip
Add relative store str/str2 ops
Diffstat (limited to 'src/uxn-core.s')
-rw-r--r--src/uxn-core.s29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/uxn-core.s b/src/uxn-core.s
index 7d5eb69..0e5cdbc 100644
--- a/src/uxn-core.s
+++ b/src/uxn-core.s
@@ -100,15 +100,15 @@ uxn_ret:
100 strb \a, [r2], #2 100 strb \a, [r2], #2
101.endm 101.endm
102 102
103.macro zsave8 val, off 103.macro zsave8 a, off
104 strb \val, [r7, \off] 104 strb \a, [r7, \off]
105.endm 105.endm
106 106
107.macro zsave16 val, off 107.macro zsave16 a, off
108 add \off, r7 108 add \off, r7
109 strb \val, [\off, #1] 109 strb \a, [\off, #1]
110 lsr \val, #8 110 lsr \a, #8
111 strb \val, [\off] 111 strb \a, [\off]
112.endm 112.endm
113 113
114.macro zload8 dst, off 114.macro zload8 dst, off
@@ -119,6 +119,17 @@ uxn_ret:
119 ldrb \dst, [r0, \off] 119 ldrb \dst, [r0, \off]
120.endm 120.endm
121 121
122.macro rsave8 a, off
123 strb \a, [r0, \off]
124.endm
125
126.macro rsave16 a, off
127 adds \off, r0
128 strb \a, [\off, #1]
129 lsr \a, #8
130 strb \a, [\off]
131.endm
132
122@ OP table 133@ OP table
123op_table: 134op_table:
124 .word brk @ 0x00 135 .word brk @ 0x00
@@ -642,9 +653,15 @@ ldr2:
642 b uxn_decode 653 b uxn_decode
643 654
644str: 655str:
656 wpop8s r4
657 wpop8 r3
658 rsave8 r3, r4
645 b uxn_decode 659 b uxn_decode
646 660
647str2: 661str2:
662 wpop8s r4
663 wpop16 r3, r5
664 rsave16 r3, r4
648 b uxn_decode 665 b uxn_decode
649 666
650lda: 667lda: