代码拉取完成,页面将自动刷新
;---------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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。