Last active
November 15, 2018 13:22
-
-
Save jimywork/d43320b1c88d8e28b0fff5efef06d12a to your computer and use it in GitHub Desktop.
First Challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.text | |
.globl main | |
main: | |
li $a0, 10 # Add value 10 to $a0 | |
li $v0, 1 # Add value 1 to $a0 | |
# Loop | |
Loop: | |
beq $a0, $zero, exit # Exit equals 0 | |
mul $v0, $a0, $v0 # Multiply $a0 by $v0 | |
add $a0, $a0, -1 | |
jal Loop | |
exit: | |
li $v0, 10 # exit syscall | |
syscall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment