From c96ba2b2678e4b92e7969c683d4cb3f1648af813 Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Sun, 19 May 2024 13:52:10 -0500 Subject: Rework assembler for simplified instruction set - Remove commas and brackets from syntax - Rename opcodes for unambiguous instruction encodings - Redesign parse instruction encoding - Implement opcode parser - Add bit-width restriction to octal parser --- string.s | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 string.s (limited to 'string.s') diff --git a/string.s b/string.s new file mode 100644 index 0000000..0ed7ca3 --- /dev/null +++ b/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 -- cgit v1.2.3