From e8bc3587cce27b25ba07469964828a327471e5ed Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Sun, 26 May 2024 17:27:25 -0500 Subject: Move string compare and fix README --- README.md | 10 ++++------ misc/string.s | 16 ++++++++++++++++ string.s | 16 ---------------- 3 files changed, 20 insertions(+), 22 deletions(-) create mode 100644 misc/string.s delete mode 100644 string.s diff --git a/README.md b/README.md index 8ebd951..960bc58 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,9 @@ and begin executing them as instructions. This is the first step in bootstrapping the whole system. -%% Better editor +## Better editor -%% A more robust and user-friendly hex-editor. -%% It can duplicate itself. +A more robust and user-friendly hex editor. ## Assembler @@ -41,7 +40,6 @@ Goals: - Reasonably extensible - Small code size -%% ## LISP Interpreter +## LISP Interpreter -%% A LISP interpreter for the Raspberry Pi Pico, -%% developed ON a raspberry pi pico +A LISP interpreter for the Raspberry Pi Pico. diff --git a/misc/string.s b/misc/string.s new file mode 100644 index 0000000..0ed7ca3 --- /dev/null +++ b/misc/string.s @@ -0,0 +1,16 @@ +// R0 : string1 address +// R1 : string2 address +// Result in R0 +string_compare: + MOVS R4, 0 +loop: + LDRB R2, [R0, R4] + LDRB R3, [R1, R4] + CMP R2, R3 + BNE done + CMP R2, 0 + BEQ done + ADDS R4, 1 + B loop +done: + BX LR diff --git a/string.s b/string.s deleted file mode 100644 index 0ed7ca3..0000000 --- a/string.s +++ /dev/null @@ -1,16 +0,0 @@ -// R0 : string1 address -// R1 : string2 address -// Result in R0 -string_compare: - MOVS R4, 0 -loop: - LDRB R2, [R0, R4] - LDRB R3, [R1, R4] - CMP R2, R3 - BNE done - CMP R2, 0 - BEQ done - ADDS R4, 1 - B loop -done: - BX LR -- cgit v1.2.3