aboutsummaryrefslogtreecommitdiffstats
path: root/src/uxn-core.s
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-08-28 20:35:18 +0200
committerBad Diode <bd@badd10de.dev>2023-08-28 20:35:18 +0200
commit6c2da62e1a5cc88dae68f0dfe3305974fb5d4467 (patch)
tree96de33a83b0b7f6b81af995893fab5551acf80e9 /src/uxn-core.s
parent9afc23da8cda2dd1380e4282ead882375ea3a5ec (diff)
downloaduxngba-6c2da62e1a5cc88dae68f0dfe3305974fb5d4467.tar.gz
uxngba-6c2da62e1a5cc88dae68f0dfe3305974fb5d4467.zip
Add absolute load instructions lda/lda2
Diffstat (limited to 'src/uxn-core.s')
-rw-r--r--src/uxn-core.s13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/uxn-core.s b/src/uxn-core.s
index 0e5cdbc..7307dce 100644
--- a/src/uxn-core.s
+++ b/src/uxn-core.s
@@ -119,6 +119,10 @@ uxn_ret:
119 ldrb \dst, [r0, \off] 119 ldrb \dst, [r0, \off]
120.endm 120.endm
121 121
122.macro aload8 dst, off
123 ldrb \dst, [r7, \off]
124.endm
125
122.macro rsave8 a, off 126.macro rsave8 a, off
123 strb \a, [r0, \off] 127 strb \a, [r0, \off]
124.endm 128.endm
@@ -665,9 +669,18 @@ str2:
665 b uxn_decode 669 b uxn_decode
666 670
667lda: 671lda:
672 wpop16 r4, r5
673 aload8 r3, r4
674 wpush8 r3
668 b uxn_decode 675 b uxn_decode
669 676
670lda2: 677lda2:
678 wpop16 r4, r5
679 aload8 r3, r4
680 wpush8 r3
681 add r4, #1
682 aload8 r3, r4
683 wpush8 r3
671 b uxn_decode 684 b uxn_decode
672 685
673sta: 686sta: