diff options
author | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-05-26 17:27:25 -0500 |
---|---|---|
committer | Jacques Comeaux <jacquesrcomeaux@protonmail.com> | 2024-05-26 17:27:25 -0500 |
commit | e8bc3587cce27b25ba07469964828a327471e5ed (patch) | |
tree | 641fdc1d6d87cebdf90f0e793a2b43ab93605205 /misc | |
parent | 50dc62be4128b6c17b4ff42c0440250526a23215 (diff) |
Move string compare and fix README
Diffstat (limited to 'misc')
-rw-r--r-- | misc/string.s | 16 |
1 files changed, 16 insertions, 0 deletions
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 |