Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions asmtest/coldbrew/N_times_Nminus1.asm
Original file line number Diff line number Diff line change
@@ -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

7 changes: 7 additions & 0 deletions asmtest/coldbrew/README.md
Original file line number Diff line number Diff line change
@@ -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.