Skip to content

Instantly share code, notes, and snippets.

@twxia
Created April 14, 2014 13:46
Show Gist options
  • Select an option

  • Save twxia/10649482 to your computer and use it in GitHub Desktop.

Select an option

Save twxia/10649482 to your computer and use it in GitHub Desktop.
compare:
add $sp, $sp, -4
sw $ra, 0($sp)
jal sub
slti $t1, $v0, 0
beq $t1, $zero, exit
addi $t1, $t1, -2
exit:
add $t1, $t1, 1
add $v0, $t1, $zero
lw $ra, 0($sp)
add $sp, $sp, 4
jr $ra
sub
sub $v0, $a0, $a1
jr $ra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment