From 50dc62be4128b6c17b4ff42c0440250526a23215 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Sun, 26 May 2024 14:23:17 -0500 Subject: Use CMP immediate --- assembler/register.s | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'assembler/register.s') diff --git a/assembler/register.s b/assembler/register.s index 348d8cf..f8197fd 100644 --- a/assembler/register.s +++ b/assembler/register.s @@ -12,33 +12,26 @@ register: ADDS R4, ('0 + 1) 10: BL get_char - MOVS R1, 'R - CMP R0, R1 + CMP R0, 'R BNE 10b BL uart_send 20: BL get_char - MOVS R1, '0 - CMP R0, R1 + CMP R0, '0 BLO 20b CMP R0, R4 BHI 20b BL uart_send - MOVS R1, '1 - CMP R0, R1 + CMP R0, '1 BNE 30f - MOVS R1, '7 - CMP R4, R1 + CMP R4, '7 BEQ 30f 50: BL get_char - // CMP R0, ' // space is stop char BEQ 60f - MOVS R1, '0 - CMP R0, R1 + CMP R0, '0 BLO 50b - MOVS R1, '5 - CMP R0, R1 + CMP R0, '5 BHI 50b BL uart_send ADDS R0, 10 @@ -47,7 +40,6 @@ register: MOV R4, R0 40: BL get_char - // CMP R0, ' // space is stop char BNE 40b POP {PC} 60: -- cgit v1.2.3