1 Star 1 Fork 0

winter-loo/Bootloader

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Boot2.asm 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
winter-loo 提交于 2015-04-14 22:01 . initial commit
;---------Phase Three: Print a string on screen------------------------
BITS 16 ; You should know that the operating system is 16 bits at the beginning, this will support BIOS INT Calls.
ORG 0x7c00 ; This bootload start at this memeory address (This is just something to remember)
jmp short Start
Print:
lodsb ; This loads the string into bytes
cmp al, 0; This compares al "Character" with 0
je Next
mov ah, 0eh
int 10h
jmp Print
Start:
mov si, msg
call Print ; This will call Print function
Next: ; After printing the welcome message, you go to here
; int 16h used for reading in a character
mov ah, 0x0
int 16h
; int 19h used for loading operating system, here for rebooting system
int 19h
cli
hlt
; db stands for "define byte"
; 0x0a stands for "newline"
; 0x0d stands for "return"
msg db "Welcome to your tiny system!", 0x0a, 0x0d, \
"Press any key...", 0
; $ evaluates to the assembly position at the beginning of the line containing the expression; so you can code
; an infinite loop using JMP $. $$ evaluates to the beginning of the current section; so you can tell how far
; into section you are by using ($ - $$)
times 510 - ($ - $$) db 0
dw 0xAA55
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Assembly
1
https://gitee.com/winter-loo/Bootloader.git
git@gitee.com:winter-loo/Bootloader.git
winter-loo
Bootloader
Bootloader
master

搜索帮助