From 1904e4e800dcf37becb3bba17c3a3aaca3c7a47c Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 11 Apr 2025 03:32:24 -0400 Subject: Add a few new test files --- input/adjacent-adder.asm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 input/adjacent-adder.asm (limited to 'input/adjacent-adder.asm') diff --git a/input/adjacent-adder.asm b/input/adjacent-adder.asm new file mode 100644 index 0000000..35704d2 --- /dev/null +++ b/input/adjacent-adder.asm @@ -0,0 +1,25 @@ +;;;;;;;; +;;; adds adjacent elements of a 4-element vector together, +;;; storing the result in place. + +.data + arr 1 2 3 4 + s 3 + i 0 + +.text + addi $5 $5 s + addi $10 $10 arr + addi $6 $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 $5 $6 + bgt L -- cgit v1.2.3