Hello world
; boot.asm | |
; setup segment register | |
mov ax, 0x07c0 | |
mov ds, ax | |
; setup display | |
mov ah, 0x0 ;setup video mode | |
mov al, 0x3 ;0x3 = text mode, color, 80x25 | |
int 0x10 ;0x10 = video service | |
mov si, msg ;target of lodsb | |
mov ah, 0x0E ;0x0E = tty | |
print_character_loop: | |
lodsb | |
or al, al | |
jz hang ;jump if zero | |
int 0x10 ;when ah is 0x0E, then print | |
jmp print_character_loop | |
msg: | |
db 'Hello World!', 13, 10, 0 ;13 = \r, 10 = \n, 0 = NULL | |
hang: | |
jmp hang | |
times 510-($-$$) db 0 | |
; this is a comment | |
db 0x55 | |
db 0xAA |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
参考URL