aboutsummaryrefslogtreecommitdiff
path: root/octedit/octedit.s
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-06-22 17:49:52 -0500
committerJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-06-22 17:49:52 -0500
commit0d7ab1ec70914e2945d0f2530f0999ecea8828fd (patch)
tree97217460aa902eed3bd99fee1bfdc6923cffdf85 /octedit/octedit.s
parentc12b1b99f2e3ab731c483bc93fa21b4763624fac (diff)
Improve octedit usability
New features: - Displays current address - Press 'B' to go back
Diffstat (limited to 'octedit/octedit.s')
-rw-r--r--octedit/octedit.s45
1 files changed, 34 insertions, 11 deletions
diff --git a/octedit/octedit.s b/octedit/octedit.s
index 9445fd8..7d9e7f4 100644
--- a/octedit/octedit.s
+++ b/octedit/octedit.s
@@ -11,24 +11,47 @@ octedit:
ldr r6, =SRAM_BASE
adds r5, r6, 1
10:
- movs r4, 0
+ movs r4, 11
+ movs r0, 0x1E
+ rors r6, r0
+ movs r0, 0x01
+ b 1f
+0:
+ movs r0, 0x1D
+ rors r6, r0
+ movs r0, 0x07
+1:
+ ands r0, r6
+ adds r0, 0x30
+ bl uart_send
+ subs r4, 1
+ bne 0b
+ movs r0, '
+ bl uart_send
20:
bl uart_recv
cmp r0, '\r
- beq 30f
- cmp r0, 'G
- beq 40f
- bl uart_send
- subs r0, '0
- lsls r4, 3
- adds r4, r0
- b 20b
-30:
+ bne 30f
bl uart_send
movs r0, '\n
bl uart_send
strh r4, [r6]
adds r6, 2
b 10b
-40:
+30:
+ cmp r0, 'G
+ bne 40f
bx r5
+40:
+ cmp r0, 'B
+ bne 50f
+ movs r0, '\r
+ bl uart_send
+ subs r6, 2
+ b 10b
+50:
+ bl uart_send
+ subs r0, '0
+ lsls r4, 3
+ adds r4, r0
+ b 20b