Home > other >  MIPS instruction, Mars software, input error
MIPS instruction, Mars software, input error

Time:11-30

. Data 
S17: asciiz "the bigger one is:"
The text
Move $fp $sp
J main
Max:
Lw $t8 0 ($sp)
Subi maintained han $sp, $sp 8
Sw $t8 0 ($sp)
Addi $sp, $sp 12
Lw $t8 0 ($sp)
Subi maintained han $sp, $sp 8
Sw $t8 0 ($sp)
Addi $sp, $sp 12
Move $$fp t8
Move $fp $sp
Subi maintained han $fp $fp 4
Sw $t8 0 ($fp)
Sw $ra - 4 ($fp)
Subi maintained han $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 $where 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 $$fp t8
Move $fp $sp
Subi maintained han $fp $fp 4
Sw $t8 0 ($fp)
Sw $ra - 4 ($fp)
Subi maintained han $sp, $sp 20
Lw $s0-8 ($fp)
Lw $s1-12 ($fp)
Lw $s2-16 ($fp)
Li $5 where v0
The syscall
Move $s0 $where v0
Li $5 where v0
The syscall
Move $s1 $where v0
Subi maintained han $sp, $sp 4
Sw $s0 0 ($sp)
Subi maintained han $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 $where v0
La $a0 S17
Li $where v0 4
The syscall
Move $a0 $s2
Li $where v0 1
The syscall
Li $where v0 10
The syscall


With MARS software, input 1, 2, error Runtime exception at 0 x004000bc: invalid integer input (5) the syscall
  • Related