diff options
author | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-21 03:18:35 -0500 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-21 03:18:35 -0500 |
commit | ccc04526f14764d856ad37b1f517308fccf886a6 (patch) | |
tree | 7c25442967b071a485a44c1da73b16ba84adc9af /newasm/input.s | |
parent | ed6f1106322f8ca4a6e26d08365bb9558ffa9d09 (diff) |
Add label and opcode parsers
Diffstat (limited to 'newasm/input.s')
-rw-r--r-- | newasm/input.s | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/newasm/input.s b/newasm/input.s index d9c8c73..f3db1e9 100644 --- a/newasm/input.s +++ b/newasm/input.s @@ -7,7 +7,7 @@ getline: PUSH {R4, R5, LR} // save registers - MOVS R4, R0 // put strbuf in R4 + MOVS R4, R0 // copy buffer start address next: BL uart_recv // get a char CMP R0, 0x03 // end of text (^C) BEQ cancel // don't submit, start on next line @@ -27,7 +27,7 @@ next: BL uart_recv // get a char BHI next good: BL uart_send // echo the printable char STRB R0, [R4, R5] // write the printable char - ADDS R5, 1 // increment strbuf offset + ADDS R5, 1 // increment buffer offset B next // get another char cancel: MOVS R5, 0 // reset offset STRB R5, [R4, R5] // write empty string @@ -77,7 +77,7 @@ retry: MOVS R0, 0x08 // backspace SUBS R2, 1 // decrement amount B 1b // repeat 2: STRB R2, [R4, R5] // terminate string - MOVS R0, R4 // copy strbuf address + MOVS R0, R4 // copy buffer start address BL putstr // print backspace sequence MOVS R5, 0 // null byte and reset offset STRB R5, [R4] // write empty string |