Compare commits

...

2 Commits

Author SHA1 Message Date
ridethepig
db53fcb438 correct error 2022-09-16 17:44:46 +08:00
ridethepig
b087c2cbd4 copy lab1 2022-09-16 16:26:35 +08:00
3 changed files with 19 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.bin

18
boot.asm Normal file
View 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 0xaa55 ; 结束标志

0
test
View File