Please debug/correct the given code. Do not fix with pseudo commands.
array A and stores the value of the element with maximum magnitude at the label maxmag:
8
.data # DO NOT change the following three labels (you may change the 10 initial values): .word 1, -14, 9, 10, -11, 6, 56, -60, 78, 100, 4, -5, 0, 11
A: 3, -5, 12, 13
maxmag: .alloc 1
.text
main:
addi $11, $0, 15
lui $1, 4097
ori $9, $1, 0
lw $16, 0($9)
addi $9, $9, 4
addi $11, $11, -1
loop:
lw $12, 0($t1)
slt $1, $12, $16
beq $1, $0, next
lw $16, 0($12)
next:
addi $11, $11, -1
addi $9, $9, 4
bne $11, $0, loop
sw $16, maxmag(0)
jr $31
syscall