From 80d8f3ae48255f786bd4d52a1819ea0c339f6946 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Fri, 23 Aug 2024 19:46:17 -0500 Subject: Add register parser and binary search for opcodes --- newasm/symbol.s | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 newasm/symbol.s (limited to 'newasm/symbol.s') diff --git a/newasm/symbol.s b/newasm/symbol.s deleted file mode 100644 index 0677f6a..0000000 --- a/newasm/symbol.s +++ /dev/null @@ -1,48 +0,0 @@ -.syntax unified -.cpu cortex-m0plus -.thumb - -.type symbol, %function -.global symbol - -// 1 unexpected begin char - -// R1 input buffer -// R2 output buffer - -symbol: PUSH {LR} - LDRB R0, [R1] // get a char - BL goodchar // check if valid symbol char - BEQ loop - MOVS R0, #1 // unexpected begin char - POP {PC} -loop: ADDS R1, 1 // consume the character - STRB R0, [R2] // store in temp buffer - ADDS R2, 1 // advance temp buffer pointer - LDRB R0, [R1] // get another character - BL goodchar // check if valid symbol char - BEQ loop // if so keep getting chars - MOVS R0, #0 // return code success - STRB R0, [R2] // write null byte - POP {PC} - -goodchar: CMP R0, '$ - BEQ good - CMP R0, '. - BEQ good - CMP R0, '0 - BLO bad - CMP R0, '9 - BLS good - CMP R0, 'A - BLO bad - CMP R0, 'Z - BLS good - CMP R0, '_ - BEQ good - CMP R0, 'a - BLO bad - CMP R0, 'z - BHI bad -good: CMP R0, R0 -bad: BX LR -- cgit v1.2.3