clear主要作用是清屏 ax=0600h初始化屏幕 cx起始位置 dx结束位置 然后调用bios中断 clear下边是设置光标的位置 ah=02h dh行,dl列 DispStr主要打印hello world 详细介绍google搜索得到。 boot/boot.asm代码:
org 07c00h
mov ax,cx
mov ds,ax
mov es,ax
call clear
call DispStr
jmp $

clear:
    mov cx,00h
    mov dx, 2580h
    mov bh, 00h
    mov ax, 0600h
    int 10h

    mov bh, 00h
    mov dh, 11h
    mov dl, 00h
    mov ah, 02h
    int 10h
    ret

DispStr:
    mov ax,BootMessage
    mov bp, ax
    mov cx, 12
    mov ax, 1301h
    mov bx, 000ch
    mov dl, 0
    int 10h
    ret

BootMessage:    db  "hello, world!"
times 510-($-$$) db 0
dw 0xaa55

上一篇:
下一篇:

相关文章:

Categories: 博客记录

2 Responses so far.

  1. 云劲松博客 说:

    记得自己第一个程序就是hello world,帮你踩个,欢迎互踩交流

    • 记得自己第一个程序就是hello world,帮你踩个,欢迎互踩交流

    0X55AA 说:

    嘿嘿,多谢

Leave a Reply