.data
.text
main:
addi $a1, $0, 1500 #add 1500 + 0 = store in $a1
addi $a2, $0, 200 #add 200 + 0 = store in $a2
jal totalAdd
li $v0, 1
addi $a0, $v1, 0
syscall
#The following code tell the system that program is done
li $v0, 10
syscall
totalAdd:
add $v1, $a1, $a2 # $a1 + $a2 = $v1
jr $ra
No comments:
Post a Comment