1
.data
prompt1: .asciiz "Enter your first number:"
prompt2: .asciiz "Enter your second number:"
.text
main:
#displays "Enter your first number:"
li $v0 4
la $a0 prompt1
syscall
#Reads the next int and stores in $s0
li $v0 5
syscall
move $s0 $v0
#displays "Enter your second number:"
li $v0 4
la $a0 prompt2
syscall
#Reads next int and stores in $s1
li $v0 5
syscall
move $s1 $v0
#Divides user input $s0/$s1 and stores in $t0
div $t0 $s0 $s1
syscall
#Print value of $t0
li $v0 1
move $t0 $v0
syscall
li $v0 10
syscall
我的代碼的目標是要求用戶輸入2個輸入並將它們分開。但是,當我在輸入「1」中運行程序時,我的輸出是一個非常高的數字。我想在MARS MIPS中劃分,但它給了我錯誤的答案