diff options
author | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-21 00:21:54 -0500 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-21 00:21:54 -0500 |
commit | ed6f1106322f8ca4a6e26d08365bb9558ffa9d09 (patch) | |
tree | 0258d4a7b0429c82b4f7af8d63106ea93e7150de /newasm/main.s | |
parent | d23ab4295a865580f6cb7bb4526978bac388b5ac (diff) |
Start new assembler
Diffstat (limited to 'newasm/main.s')
-rw-r--r-- | newasm/main.s | 34 |
1 files changed, 34 insertions, 0 deletions
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} |