我试图弄清楚为什么它会在 div 之后立即中断。也许我设置 div 错误?或存储错误?另外,我是否称它为打印总距离?
li $t0, 284 #distance in miles from OR to WA
li $t1, 387 #6 hours and 27 minutes, 6 hours = 360 minutes +27 minutes, 387 minutes
li $t2, 5280 #5280 feet in a mile
li $t3, 60 #60 seconds in a minutes
main:
mult $t0, $t2 #gets the total feet in the 284 miles and places it into $t4
mfhi $t4
mult $t1, $t3 #gets the total seconds in the 6 hours an 27 minutes
mfhi $t5
div $t4, $t5 #divides the total feet by the total seconds
mflo $t6
li $v0, 1
move $a0, $t6
syscall
addi $v0, $zero, 10 ##system call to leave the program
syscall ##exits the program