.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 mul $t4, $t1, $t3 add $t4, $t4, $t0 #t0 = iterator * offset li $v0, 1 lw $a0, ($t4) #lw $a0, 0($t4) syscall li $v0, 4 la $a0, linefeed syscall addi $t1, $t1, 1 #increase iterator j loop exit: #exit program li $v0, 10 syscall