# Simple MIPS program that computes: # num1 = num1 + num2 # where num1 and num2 are numbers stored in memory. .data num1: .word 5 # place decimal 5 in memory num2: .word 6 # place decimal 6 in memory .text .globl main main: la $s0, num1 # la = load address (psuedo-instruction not in book) la $s1, num2 lw $t0, 0($s0) # $t0 <- value at num1 lw $t1, 0($s1) # $t1 <- value at num2 add $t2, $t0, $t1 sw $t2, 0($s0) # There are also useful psuedo-instructions that make it possible # to lw or sw directly from/to a label: # lw $t2, num1 # sw $t2, num1