From a63eba62ae9faffea51ba618b0d20f132c23c452 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Fri, 26 Jan 2024 17:58:33 -0600 Subject: Improve assembler sketch --- assembler/get_char.s | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 assembler/get_char.s (limited to 'assembler/get_char.s') diff --git a/assembler/get_char.s b/assembler/get_char.s new file mode 100644 index 0000000..f1f43e7 --- /dev/null +++ b/assembler/get_char.s @@ -0,0 +1,21 @@ +// R9: end_char +get_char: + PUSH {LR} + BL uart_recv + MOVS R1, 025 // ^U (NAK) + CMP R0, R1 + BEQ redo_line + MOVS R1, 004 // ^D (EOT) + CMP R0, R1 + BEQ done_for_real + CMP R0, R9 + POP {PC} + +get_line: + BL get_char + ... + B get_line + +redo_line: + ... + B get_line -- cgit v1.2.3