#This simple program illustrates the use of arithmatic/logic #instructions, load/store and two psuedoinstructions. #It also illustrates how MIPS programs are organized. #This shows add and sll, but you can experiment with other #operate instructions. #Y.K. Malaiya, 2/21/2008 .text #beginning of instructions .globl main main: la $s1, x #initialize $s1 as a pointer #operation one lw $t0, 0($s1) #first word lw $t1, 4($s1) #second word add $t2, $t1, $t0 #operation sw $t2, 8($s1) #save result #operation two lw $t0, 0($s1) #first word sll $t2, $t0, 2 #operation sw $t2, 12($s1) #save result li $v0, 10 # Quit syscall .data #beginning of data x: .word 0x0f .word 0x11 .word 0x00 #first result .word 0x00 #second result