diff options
Diffstat (limited to 'input/adjacent-adder-vector.asm')
-rw-r--r-- | input/adjacent-adder-vector.asm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/input/adjacent-adder-vector.asm b/input/adjacent-adder-vector.asm new file mode 100644 index 0000000..80bc8a3 --- /dev/null +++ b/input/adjacent-adder-vector.asm @@ -0,0 +1,18 @@ +;;;;;;;; +;;; adds adjacent elements of a 4-element vector together, +;;; storing the result in place. Uses the vector type. + +.data + arr 1 2 3 4 + s 3 +.text + load $4 s($0) ; set the vector-length register + addi $5 $0 arr + loadv $16 0($5) + addi $5 $5 0x1 + loadv $17 0($6) + addv $16 $16 $17 + storev $16 arr($0) + nop + nop + nop |