]>
wirehaze git hosting - lifeboot.git/blob - lifeboot.asm
4 %
define ORG 0x7c00 ; where we are loaded initially
6 %
define VGA_SEG
0xb800 ; video memory starts at 0xb8000
9 %
define VGA_LENW VGA_COL
* VGA_ROW
12 %
define PRINT_COLOR
0x07 ; grey on black
14 ; entry point -----------------------------------------------------------------
16 ; initialize segment registers
26 ; clear screen ----------------------------------------------------------------
38 mov ax, (PRINT_COLOR
<< 8) | FILL_CHAR
40 rep stosw ; fill cx words at es:di with ax
42 ; errors ----------------------------------------------------------------------
47 ; print the error message string in si and halt
48 ; note: we assume es = VGA_SEG and ds = 0
53 ; es:di = video memory
54 ; ds:si = error message
56 ; ah = color attribute
59 lodsb ; al = [ds:si], si += 1
60 or al, al ; on null terminator,
62 stosw ; [es:di] = ax, di += 2
66 cli ; disable interrupts
70 ; data ------------------------------------------------------------------------
76 times 510 - ($ - $$) db 0 ; fill remaining bytes with zeroes
77 dw 0xaa55 ; mbr magic byte