From ed6f1106322f8ca4a6e26d08365bb9558ffa9d09 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Wed, 21 Aug 2024 00:21:54 -0500 Subject: Start new assembler --- newasm/main.s | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 newasm/main.s (limited to 'newasm/main.s') diff --git a/newasm/main.s b/newasm/main.s new file mode 100644 index 0000000..7f3c038 --- /dev/null +++ b/newasm/main.s @@ -0,0 +1,34 @@ +.syntax unified +.cpu cortex-m0plus +.thumb + +.type main, %function +.global main, strbuf + +main: LDR R6, =0x20002000 + BL uart_recv +loop: BL prompt + LDR R0, strbuf + BL getline + LDR R0, strbuf + BL putstr + LDR R0, =crlf + BL putstr + B loop + BL uart_recv + LDR R0, =0x20000001 + BX R0 + + .align 4 +strbuf: .word 0x20001F00 + +prompt: PUSH {LR} + MOVS R0, R6 + BL send_hex + MOVS R0, ' + BL uart_send + LDR R0, [R6] + BL send_hex + MOVS R0, ' + BL uart_send + POP {PC} -- cgit v1.2.3