.data k: # 0x10010000 is where the data starts (k) 13 k1: # 0x10010004 is k1 16 15 .text # The next couple lines show you how to load data from memory. # The addresses of data stored in memory are too large to specify in 16 # bits. So, you need two instructions. The first loads: # 0x10010000 into $t3. lui $t3,0x1001 # This loads M[0x10010000 + 0x4] into $t0. So, this load [k1] into memory lw $t0 4($t3) addi $t3,$zero,4 addi $t0,$t0,33 # It's interesting to figure out the assembly code for the Exit instruction. # The jumpaddr: 31:28 of PC; address in machine code; 00 (to multiple it by 4) # So, basically, the address in the machine code is the number of instructions from the jump # instruction to the label. j Exit addi $t1,$t0,33 addi $t1,$t0,33 Exit: addi $t1,$t0,33