diff options
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} |