copy lab1
This commit is contained in:
parent
387f0ee89c
commit
b087c2cbd4
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.bin
|
||||||
18
boot.asm
Normal file
18
boot.asm
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
org 07c00h ; 告诉编译器程序加载到7c00处
|
||||||
|
mov ax, cs
|
||||||
|
mov ds, ax
|
||||||
|
mov es, ax
|
||||||
|
call DispStr ; 调用显示字符串例程
|
||||||
|
jmp $ ; 无限循环
|
||||||
|
DispStr:
|
||||||
|
mov ax, BootMessage
|
||||||
|
mov bp, ax ; ES:BP = 串地址
|
||||||
|
mov cx, 16 ; CX = 串长度
|
||||||
|
mov ax, 01301h ; AH = 13, AL = 01h
|
||||||
|
mov bx, 000ch ; 页号为0(BH = 0) 黑底红字(BL = 0Ch,高亮)
|
||||||
|
mov dl, 0
|
||||||
|
int 10h ; 10h 号中断
|
||||||
|
ret
|
||||||
|
BootMessage: db "Hello, OS world!"
|
||||||
|
times 510-($-$$) db 0 ; 填充剩下的空间,使生成的二进制代码恰好为512字节
|
||||||
|
dw 0x55aa ; 结束标志
|
||||||
Loading…
Reference in New Issue
Block a user