문제

I'm using MARS. Is it possible to read a character from console without echo? Like int 21h / 08h in DOS. Or is there a way to hack it?

도움이 되었습니까?

해결책

Yes, you can use MMIO to poll the keyboard in 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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top