.set noreorder
#include <regdef.h>
.data
fmt: .asciiz "%s "
newline: .asciiz "\n"
.text
.extern __iob
.globl main
.ent main
main:
move s1, a0 # s1 <- argc
move s2, a1 # s2 <- argv
li s0, 1
.L1:
la a0, fmt # first argument, format string
move a1, s0 # second argument, i
sll t0, s0, 2 # t0 = i << 2
add t0, s2, t0 # t0 = argv + (i << 2)
lw a1, (t0) # third argument: argv[i]
jal printf
addi s0, s0, 1
bne s0, s1, .L1
nop
la a0, newline
jal printf
nop
li a0, 0
jal exit
nop
.end main