diff options
author | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-23 19:46:17 -0500 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-08-23 19:46:17 -0500 |
commit | 80d8f3ae48255f786bd4d52a1819ea0c339f6946 (patch) | |
tree | 70126a16181caf459cfcf79fce983655a7a704e5 /newasm/label.s | |
parent | b08def431c09449b5ad2ff4379fb403b2e1bf67b (diff) |
Add register parser and binary search for opcodes
Diffstat (limited to 'newasm/label.s')
-rw-r--r-- | newasm/label.s | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/newasm/label.s b/newasm/label.s deleted file mode 100644 index af2f641..0000000 --- a/newasm/label.s +++ /dev/null @@ -1,30 +0,0 @@ -.syntax unified -.cpu cortex-m0plus -.thumb - -.type label, %function -.global label - -// 1 unexpected begin char -// 2 doesn't end with colon - -// R1 input buffer -// R2 output buffer - -label: PUSH {LR} - LDRB R0, [R1] // get a char - CMP R0, 0x61 // a - BLO 1f - CMP R0, 0x7A // z - BLS 2f -1: MOVS R0, #1 // return code 1 (expected lowercase) - POP {PC} -2: BL symbol - LDRB R0, [R1] // get a char - CMP R0, ': // colon - BEQ 3f - MOVS R0, #2 // return code 2 (expected colon) - POP {PC} -3: ADDS R1, 1 // consume the colon - MOVS R0, #0 // return code 0 (success) - POP {PC} |