Code: Select all
org 7c00h
jmp start
nop
bs_OEM db "MSDOS5.0"
A_BF_BPB_BytesPerSector DW 200h
A_BF_BPB_SectorsPerCluster DB 8h
A_BF_BPB_ReservedSectors DW 01f0h
A_BF_BPB_NumberOfFATs DB 02
A_BF_BPB_RootEntries DW 0
A_BF_BPB_TotalSectors DW 0
A_BF_BPB_MediaDescriptor DB 0f8h
A_BF_BPB_SectorsPerFAT DW 0
A_BF_BPB_SectorsPerTrack DW 03fh
A_BF_BPB_Heads DW 0ffh
A_BF_BPB_HiddenSectors DW 080h
A_BF_BPB_HiddenSectorsHigh DW 0h
A_BF_BPB_BigTotalSectors DW 3f00h
A_BF_BPB_BigTotalSectorsHigh DW 03ch
A_BF_BPB_BigSectorsPerFat DW 0f08h
A_BF_BPB_BigSectorsPerFatHi DW 0h
A_BF_BPB_ExtFlags DW 0
A_BF_BPB_FS_Version DW 0
A_BF_BPB_RootDirStrtClus DW 2
A_BF_BPB_RootDirStrtClusHi DW 0
A_BF_BPB_FSInfoSec DW 1h
A_BF_BPB_BkUpBootSec DW 6h
A_BF_BPB_Reserved DW 6 DUP (?)
BS_physical dw 80h
BS_bootrecord db 29h
volumeid dd 0AE6DA6B2h
volumelabel db "No Name "
filesystem db "FAT32 "
start:
cli
xor eax, eax
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
; create stack
mov ss, ax
mov sp, 0x7c00
sti
; post message
mov si, msgLoading
call DisplayMessage
hang:
jmp hang
DisplayMessage:
lodsb ; load next character
; test for NUL character
jz .DONE
mov ah, 0x0E ; BIOS teletype
mov bh, 0x00 ; display page 0
mov bl, 0x07 ; text attribute
int 0x10 ; invoke BIOS
jmp DisplayMessage
.DONE:
ret
msgLoading DB "Hello, world!", 0
TIMES 510-($-$$) DB 0
DW 0xAA55
Best regards,