aboutsummaryrefslogtreecommitdiff
path: root/newasm/string.s
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-08-23 19:46:17 -0500
committerJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-08-23 19:46:17 -0500
commit80d8f3ae48255f786bd4d52a1819ea0c339f6946 (patch)
tree70126a16181caf459cfcf79fce983655a7a704e5 /newasm/string.s
parentb08def431c09449b5ad2ff4379fb403b2e1bf67b (diff)
Add register parser and binary search for opcodes
Diffstat (limited to 'newasm/string.s')
-rw-r--r--newasm/string.s6
1 files changed, 4 insertions, 2 deletions
diff --git a/newasm/string.s b/newasm/string.s
index c77958b..d897a98 100644
--- a/newasm/string.s
+++ b/newasm/string.s
@@ -28,7 +28,8 @@ putstrln:
BL putstr
POP {PC}
-cmpstr: MOVS R4, 0
+cmpstr: PUSH {R4}
+ MOVS R4, 0
1: LDRB R2, [R0, R4]
LDRB R3, [R1, R4]
CMP R2, R3
@@ -37,4 +38,5 @@ cmpstr: MOVS R4, 0
BEQ 2f
ADDS R4, 1
B 1b
-2: BX LR
+2: POP {R4}
+ BX LR