使用MARS软件,输入 1 2,报错Runtime exception at 0x004000bc: invalid integer input (syscal
程序代码:
.data S17: .asciiz "the bigger one is:" .text move $fp $sp j main max: lw $t8 0($sp) subi $sp $sp 8 sw $t8 0($sp) addi $sp $sp 12 lw $t8 0($sp) subi $sp $sp 8 sw $t8 0($sp) addi $sp $sp 12 move $t8 $fp move $fp $sp subi $fp $fp 4 sw $t8 0($fp) sw $ra -4($fp) subi $sp $sp 20 lw $s0 -8($fp) lw $s1 -12($fp) bge $s0 $s1 LABEL3 move $t0 $zero j LABEL4 LABEL3: li $t0 1 LABEL4: beq $t0 $zero LABEL0 move $v0 $s0 sw $s0 -8($fp) sw $s1 -12($fp) lw $ra -4($fp) addi $sp $fp 4 lw $fp 0($fp) jr $ra LABEL0: main: move $t8 $fp move $fp $sp subi $fp $fp 4 sw $t8 0($fp) sw $ra -4($fp) subi $sp $sp 20 lw $s0 -8($fp) lw $s1 -12($fp) lw $s2 -16($fp) li $v0 5 syscall move $s0 $v0 li $v0 5 syscall move $s1 $v0 subi $sp $sp 4 sw $s0 0($sp) subi $sp $sp 4 sw $s1 0($sp) sw $s0 -8($fp) sw $s1 -12($fp) sw $s2 -16($fp) jal max lw $s0 -8($fp) lw $s1 -12($fp) lw $s2 -16($fp) move $s2 $v0 la $a0 S17 li $v0 4 syscall move $a0 $s2 li $v0 1 syscall li $v0 10 syscall