]>
wirehaze git hosting - lifeboot.git/blob - lifeboot.asm
a3b4658fbbf6f6c1839718c149188cc457a8587a
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
11 %
define FILL_CHAR
0xfa ; middle dot
12 %
define FILL_COLOR
0x04 ; red on black
13 %
define PRINT_COLOR
0x07 ; grey on black
15 ; entry point -----------------------------------------------------------------
17 ; initialize segment registers
27 ; clear screen ----------------------------------------------------------------
39 mov ax, (FILL_COLOR
<< 8) | FILL_CHAR
41 rep stosw ; fill cx words at es:di with ax
43 ; errors ----------------------------------------------------------------------
48 ; print the error message string in si and halt
49 ; note: we assume es = VGA_SEG and ds = 0
54 ; es:di = video memory
55 ; ds:si = error message
57 ; ah = color attribute
60 lodsb ; al = [ds:si], si += 1
61 or al, al ; on null terminator,
63 stosw ; [es:di] = ax, di += 2
67 cli ; disable interrupts
71 ; data ------------------------------------------------------------------------
77 times 510 - ($ - $$) db 0 ; fill remaining bytes with zeroes
78 dw 0xaa55 ; mbr magic byte