我试图在Mars MIPS中显示一个字符(然后最终显示整个字符串,但我现在正处理一个字符)。
.data
.text
main:
jal emitchar
jal LOOP
jal LOOP2
emitchar:
lui $t0, 0xFFFF # $t0 stores the address of the receiver control
jr $ra
LOOP:
lw $t1, 0($t0) # $t1 stores the entire 32-bits of the receiver control
andi $t2, $t1, 0x0001 # $t2 stores the last bit (ready-bit) of the control
beq $t2, $zero, LOOP # if the ready-bit is 0 (not ready) loop until it is
lw $s0, 4($t0) # load the data into $v0
jr $ra
LOOP2:
lw $t1, 8($t0) # $t1 is the address of transmitter control
andi $t2, $t1, 0x0001 # $t2 is the ready-but of the transmitter control
beq $t2, $zero, LOOP2 # if the ready-bit is 0 (not ready) loop until it is
sw $s0, 12($t0)
jr $ra
调试时,我注意到我在LOOP过程中遇到了无限循环。关于从哪里去的任何指示?