aboutsummaryrefslogtreecommitdiff
path: root/hexedit/hexedit.s
diff options
context:
space:
mode:
Diffstat (limited to 'hexedit/hexedit.s')
-rw-r--r--hexedit/hexedit.s25
1 files changed, 25 insertions, 0 deletions
diff --git a/hexedit/hexedit.s b/hexedit/hexedit.s
new file mode 100644
index 0000000..0bc03a9
--- /dev/null
+++ b/hexedit/hexedit.s
@@ -0,0 +1,25 @@
+.syntax unified
+.cpu cortex-m0plus
+.thumb
+
+.type hexedit, %function
+.global hexedit
+
+hexedit:
+ ldr r2, =0x20000100
+ movs r1, 0
+getchar:
+ bl uart_recv
+ cmp r0, 'g
+ beq stop
+ subs r0, '0 // The ASCII char '0'
+ bmi next
+ lsls r1, 4
+ adds r1, r0
+ b getchar
+next:
+ ldr r0, [r2, 0]
+ adds r2, 4
+ b hexedit
+stop:
+ b 0x20000100