2013-06-19 44 views
0

我们可以使用系统调用来打印一些与垃圾信息,如:如何打印字符串串口没有操作系统,在MIPS

la, $a0, mes 
    li, $v0, 4 
    syscall 

但经过我tftp 0 file.binboot它没有打印任何东西,到串行港口。

虽然在X86 int 10h的作品。

+0

'INT 10h'与显卡接口提供的功能。你的意思是[int 14h](http://www.ctyme.com/intr/int-14.htm)? – Michael

回答

2

您将不得不知道串行端口接口在目标系统上的样子。例如,如果Write ControlWrite Data寄存器位于0xFFFF00080xFFFF000C,因为它们在SPIM,你可以做这样的事情(未经测试):

la $a0, my_asciiz_string 
li $a1, 0xFFFF0008 

loop: 
    lw $t0, ($a1) # check if the serial port is ready to be written to 
    beq $t0, $zero, loop 
    nop 

    lbu $t0,($a0) # load one character from the string 
    beq $t0,$zero,done 
    nop 

    addiu $a0,$a0,1 
    sw $t0, 4($a1) # write the character to the serial port 
    j loop 
done: