.data array: .word 1, 2, 3, 4 linefeed: .asciiz "\n" array_size: .word 4 .text main: la $t0, array #store base address of array in register t0 li $t1, 0 #iterator lw $t2, array_size #size of the array li $t3, 4 #offset #print elements of array loop: bge $t1, $t2, exit li $v0, 1 lw $a0, ($t0) #lw $a0, 0($t0) syscall li $v0, 4 la $a0, linefeed syscall add $t0, $t0, $t3 #t0 = iterator * offset addi $t1, $t1, 1 #increase iterator j loop exit: #exit program li $v0, 10 syscall