Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用火星。是否可以在没有回显的情况下从控制台读取字符?就像int 21h / 08h在 DOS 中一样。或者有没有办法破解它?
int 21h / 08h
是的,您可以使用 MMIO 在 SPIM/MARS 中轮询键盘:
li $t0,0xffff0000 # ffff0000 = Receiver (keyboard) control wait_for_key: lw $t1,($t0) andi $t1,$t1,0x0001 # Check the "ready" bit beq $t1,$0,wait_for_key lw $v0,4($t0) # ffff0004 = Receiver data