Skip to content

Instantly share code, notes, and snippets.

@jimywork
Last active November 15, 2018 13:22
Show Gist options
  • Save jimywork/d43320b1c88d8e28b0fff5efef06d12a to your computer and use it in GitHub Desktop.
Save jimywork/d43320b1c88d8e28b0fff5efef06d12a to your computer and use it in GitHub Desktop.
First Challenge
.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