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.