From f2f186c3594a922e51abf25b24052c61f833a2bf Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Tue, 4 Jun 2024 19:28:25 -0500 Subject: Rename stage 0 editor --- octedit/octedit.s | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 octedit/octedit.s (limited to 'octedit/octedit.s') diff --git a/octedit/octedit.s b/octedit/octedit.s new file mode 100644 index 0000000..9445fd8 --- /dev/null +++ b/octedit/octedit.s @@ -0,0 +1,34 @@ +.syntax unified +.cpu cortex-m0plus +.thumb + +.equ SRAM_BASE, 0x20000000 + +.type octedit, %function +.global octedit + +octedit: + ldr r6, =SRAM_BASE + adds r5, r6, 1 +10: + movs r4, 0 +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: + bl uart_send + movs r0, '\n + bl uart_send + strh r4, [r6] + adds r6, 2 + b 10b +40: + bx r5 -- cgit v1.2.3