it compiles but in the output, it does not show anywhere I can input numbers. Have any idea?
.data
msg1: .asciiz "array printing "
msg2: .asciiz "enter the number of rows: "
msg3: .asciiz "enter the number of cols: "
msg4: .asciiz "the value at the location is: "
EOL: .byte '\n'
SPACES: .asciiz " "
MATRIX: .word 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
.text
.globl main
main:
li $v0,4
la $a0,msg1
syscall
addiu $sp,$sp,-4
sw $ra,0($sp)
jal PRTMTX
lw $ra,0($sp)
addiu $sp,$sp,4
li $v0, 10
syscall
PRTMTX:
la $s0, MATRIX
li $s1,1
li $s2,1
li $s6,5
TOPPRT:
addiu $t1,$s1,-1
addiu $t2,$s2,-1
li $t4,20
li $t5,4
mul $t1,$t1,$t4
mul $t2,$t2,$t5
add $s4,$s0,$t1
add $s4,$s4,$t2
li $v0,1
lw $a0,0($s4)
syscall
li $v0,4
la $a0,SPACES
syscall
li $t6,5
div $s2,$t6
mfhi $t6
beqz $t6,ENDROW
addiu $s2,$s2,1
j TOPPRT
ENDROW: li $s2,1
li $v0, 11
lb $a0,EOL
syscall
li $t6,5
div $s1,$t6
mfhi $t6
beqz $t6,DONEPRT
addiu $s1,$s1,1
j TOPPRT
DONEPRT:
jr $ra
PRTNUM:
move $t1,$a0
move $t2,$a1
addiu $t1,$t1,-1
addiu $t2,$t2,-1
li $t3,20
mul $t1,$t1,$t3
li $t3,4
mul $t2,$t2,$t3
la $s0,MATRIX
add $s0,$s0,$t1
add $s0,$s0,$t2
li $v0,4
la $a0,msg4
syscall
lw $a0,0($s0)
li $v0,1
syscall
EXIT:
li $v0, 10
syscall