To make a bootable 1.44MB disk image, create a binary file
exactly 1474560. The first 512 bytes of this image at the
very beginning will be the Boot Record.
Stack may not be initialized upon entry. If so set up
your own stack.
mov ax, cs
mov ss, ax ; will disable interrupts until end of next instruction.
mov sp, my_stack
ORG 7C00H ; The ROM will place your code at 07C00H
MyFirstBootLoader:
MOV SI, MSG ; Load SI with offset of Message
CLD ; Clear DF bit for string operation
DisplayMessage:
LODSB ; Load byte of string into AL
CMP AL, 0
JZ BootOver ; Exit if byte was zero
MOV AH, 0EH ; Function 0EH Write in TTY Mode
MOV BH, 0 ; Display Page Zero (Should be current)
INT 10H ; Video Services Interrupt (BIOS)
JMP DisplayMessage
BootOver:
JMP BootOver ; Infinite Loop
MSG DB 'Hello World', 0DH, 0AH, 0