MIPS无法通过循环

时间:2019-09-18 06:00:05

标签: mips smips

为什么我的程序在bge $ t0,$ v0,FirstNLargest处停止?它将到达子程序并在那里执行代码,但不会返回并完成main中的其余代码。


.data
    FirstN: .word 0
    SecondN: .word 0
    Largest: .word 0
.globl main
.text

main:
# lots of missing code
# Compare both numbers and store largest in 0x10010008
lui $t0, 0x1001 

bge $t0, $v0, FirstNLargest


# Print value in 0x10010008
lui $t0, 0x1001
addi $t0, $t0, 0
lw $a0, 8($t0)  
addi $v0, $0, 1 
syscall


li $v0, 10
syscall

# Stores user's first input in Largest
FirstNLargest: 
sw $t0, Largest

0 个答案:

没有答案