From 41baa17a9855bc970becf3dab02f7014753b45db Mon Sep 17 00:00:00 2001 From: bd Date: Thu, 10 Apr 2025 02:11:43 -0400 Subject: Fix the rest of the initial parsing bugs, add high-level tests --- input/add-loop-directive.asm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 input/add-loop-directive.asm (limited to 'input/add-loop-directive.asm') diff --git a/input/add-loop-directive.asm b/input/add-loop-directive.asm new file mode 100644 index 0000000..5bccff3 --- /dev/null +++ b/input/add-loop-directive.asm @@ -0,0 +1,21 @@ +.data + arr 1 2 3 4 + s 3 + i 0 + +.text + load $5 s + load $10 arr + load $6 i + jrl CMP +L: + add $9 $10 $6 + load $7 0($9) + load $8 1($9) + add $7 $7 $8 + + store $7 0($9) + addi $6 $6 0x1 +CMP: + cmp $6 $5 + bgt L -- cgit v1.2.3