如何在蓝屏​​上打印文本? [英] How do I print text on the blue screen?

查看:82
本文介绍了如何在蓝屏​​上打印文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题.如何在蓝屏​​上打印文本?

I have one of problem. How do I print text on the blue screen?

start:
        mov ax, 07C0h
        add ax, 288
        mov ss, ax
        mov sp, 4096
        mov ax, 07C0h
        mov ds, ax
;-------------------------------------------------
        mov ah, 09h
        mov cx, 1000h
        mov al, 20h
        mov bl, 17h
        mov si, text_string
        int 10h
        jmp $
        text_string db 'This is my Operating System!', 0
print_string:
        mov ah, 0Eh
.repeat:
        lodsb
        cmp al, 0
        je .done
        int 10h
        jmp .repeat
.done:
        ret
        times 510-($-$$) db 0
        dw 0xAA55           

这是我的代码.我写了mov si, text_string,但它不起作用.请帮助我.

This is my code. I write mov si, text_string but it not works. Please help me.

推荐答案

您的 print_string 例程使用BIOS电传打字功能将字符显示在屏幕上.不幸的是,在处理文本模式屏幕时,此功能不会以任何特定颜色输出.

Your print_string routine uses the BIOS teletype function to put characters on screen. Unfortunately this function will not output in any particular color when dealing with the text mode screens.

由于您的目标是在蓝色屏幕上打印字符,因此请首先确保屏幕实际上是蓝色的.

Since your aim is to print characters on the blue screen, first make sure the screen is actually blue.

        mov dx, 184Fh   ; lower right (79,24)
        xor cx, cx      ; upper left (0,0)
        mov bh, 1Fh     ; brightwhite on blue
        mov ax, 0600h   ; clear screen
        int 10h

此后,您可以call使用BIOS电传打字功能的 print_string 例程:

Hereafter you can call your print_string routine that uses the BIOS teletype function:

        mov  si, text_string
        call print_string
        jmp  $

        text_string db 'This is my Operating System!', 0

print_string:
        mov  ah, 0Eh
        jmp  .first
.print: int  10h
.first: lodsb
        test al, al
        jnz  .print
        ret

这篇关于如何在蓝屏​​上打印文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆