aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assembler/register.s25
1 files changed, 24 insertions, 1 deletions
diff --git a/assembler/register.s b/assembler/register.s
index 9fbc76c..dd0e1ae 100644
--- a/assembler/register.s
+++ b/assembler/register.s
@@ -1,4 +1,4 @@
-register:
+register4:
PUSH {LR}
10:
BL get_char
@@ -37,3 +37,26 @@ register:
60:
MOVS R4, 1
POP {PC}
+
+register3:
+ PUSH {LR}
+10:
+ BL get_char
+ MOVS R1, 'R
+ CMPS R0, R1
+ BNE 10b
+20:
+ BL get_char
+ MOVS R1, '0
+ CMPS R0, R1
+ BLO 20b
+ MOVS R1, '7
+ CMPS R0, R1
+ BHI 20b
+30:
+ SUBS R0, '0
+ MOVS R4, 0
+ ORRS R4, R0
+ BL get_char
+ BNE 40b
+ POP {PC}