浏览代码

clear the screen before printing.

Lucas Stadler 11 年之前
父节点
当前提交
1cd085d2a2
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      os/first.asm

+ 9 - 0
os/first.asm

@ -11,6 +11,9 @@ start:
11 11
        mov ax, 0x07c0
12 12
        mov ds, ax
13 13
14
        ;; clear the screen
15
        call clear_screen
16
14 17
        mov si, text_string     ; put string position into si
15 18
        call print_string
16 19
@ -19,6 +22,12 @@ start:
19 22
20 23
        text_string db 'This is my very first OS!', 0
21 24
25
clear_screen:
26
        mov ah, 0x00            ; "set video mode"
27
        mov al, 0x03            ; 80x25
28
        int 0x10
29
        ret
30
22 31
print_string:                   ; output string in `si` to screen
23 32
        mov ah, 0x0e            ; int 0x10 'print char' function
24 33