Created
May 4, 2014 20:52
-
-
Save tonussi/c0b73f99980256799bae to your computer and use it in GitHub Desktop.
patterson exercise 2-21-1b
This file contains hidden or 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
.data | |
my_global: .word 100 | |
.text | |
.globl main | |
main: | |
la $t0, my_global | |
lw $t1, 0($t0) | |
addi $t1, $t1, 1 | |
sw $t1, 0($t0) | |
addi $a0, $t1, 0 | |
jal leaf_funct | |
addi $s3, $v0, 0 | |
j exit | |
leaf_funct: | |
addi $sp, $sp, -4 | |
sw $ra, 0($sp) | |
addi $v0, $a0, 1 | |
lw $ra, 0($sp) | |
addi $sp, $sp, 4 | |
jr $ra | |
exit: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment