求助:Runtime exception at 0x004000bc: invalid integer input (syscall 5)
阿新 • • 發佈:2020-07-04
程式碼
.data
S17: .asciiz "the bigger one is:"
.text
move $fp $sp
j main
max:
lw $t8 ($sp)
subi $sp $sp
sw $t8 ($sp)
addi $sp $sp
lw $t8 ($sp)
subi $sp $sp
sw $t8 ($sp)
addi $sp $sp
move $t8 $fp
move $fp $sp
subi $fp $fp
sw $t8 ($fp)
sw $ra -($fp)
subi $sp $sp
lw $s0 -($fp)
lw $s1 -($fp)
bge $s0 $s1 LABEL3move $t0 $zero
j LABEL4
LABEL3:
li $t0
LABEL4:
beq $t0 $zero LABEL0
move $v0 $s0
sw $s0 -($fp)
sw $s1 -($fp)
lw $ra -($fp)
addi $sp $fp
lw $fp ($fp)
jr $ra
LABEL0:
main:
move $t8 $fp
move $fp $sp
subi $fp $fp
sw $t8 ($fp)
sw $ra -($fp)
subi $sp $sp
lw $s0 -($fp)
lw $s1 -($fp)
lw $s2 -($fp)
li $v0
syscall
move $s0 $v0li $v0
syscall
move $s1 $v0
subi $sp $sp
sw $s0 ($sp)
subi $sp $sp
sw $s1 ($sp)
sw $s0 -($fp)
sw $s1 -($fp)
sw $s2 -($fp)
jal max
lw $s0 -($fp)
lw $s1 -($fp)
lw $s2 -($fp)
move $s2 $v0
la $a0 S17
li $v0
syscall
move $a0 $s2
li $v0
syscall
li $v0
syscall
使用MARS軟體,輸入 1 2 ,報錯,如題