From 52560124bc0f9577710a25a7e24d4bc4af0a49a1 Mon Sep 17 00:00:00 2001 From: Corey Date: Sun, 3 Nov 2019 18:49:49 -0500 Subject: [PATCH] adding test --- asmtest/coldbrew/N_times_Nminus1.asm | 19 +++++++++++++++++++ asmtest/coldbrew/README.md | 7 +++++++ 2 files changed, 26 insertions(+) create mode 100644 asmtest/coldbrew/N_times_Nminus1.asm create mode 100644 asmtest/coldbrew/README.md diff --git a/asmtest/coldbrew/N_times_Nminus1.asm b/asmtest/coldbrew/N_times_Nminus1.asm new file mode 100644 index 0000000..7889cc2 --- /dev/null +++ b/asmtest/coldbrew/N_times_Nminus1.asm @@ -0,0 +1,19 @@ +addi $t0, $zero, 0 #counter for computing n * n-1 +addi $t1, $zero, 1 +addi $t2, $zero, 5 #n + +sub $t3, $t2, $t1 #sets t3 to n-1 (multiplier) + +addi $t5, $zero, 0 # running total + +bne $t0, $t3, ADDN + +ADDN: + add $t5, $t5, $t2 + addi $t0, $t0, 1 + bne $t0, $t3, ADDN + beq $t0, $t3, END + +END: + add $v0, $t5, $zero + \ No newline at end of file diff --git a/asmtest/coldbrew/README.md b/asmtest/coldbrew/README.md new file mode 100644 index 0000000..33b8d78 --- /dev/null +++ b/asmtest/coldbrew/README.md @@ -0,0 +1,7 @@ +# N * N-1 +### Authors: Corey and Adi + +#Code +Our test does a simple multiplication and addition operation then stores it in the solution register. + +No special requirements. The expected result is 20 as the current input is 5.