28 lines
620 B
NASM
28 lines
620 B
NASM
; this offsets all memory addresses in the asm code
|
|
; to be relative to the start of the assembled bytecode
|
|
; in memory, where the BIOS loads it.
|
|
[org 0x7c00]
|
|
[bits 16]
|
|
|
|
; store the boot drive - bios puts in dl
|
|
mov [i_global_boot_drive], dl
|
|
|
|
jmp main16 ; start the main label
|
|
|
|
i_global_boot_drive: db 0
|
|
|
|
; Helper label that pops all stack registers and returns
|
|
; Used as a one-line return in service routines
|
|
; e.g. jmp global_return
|
|
g_return:
|
|
popa
|
|
ret
|
|
|
|
; Include common code
|
|
%include "print16.asm"
|
|
%include "disk16.asm"
|
|
%include "gdt16.asm"
|
|
%include "switch16.asm"
|
|
%include "kern16.asm"
|
|
%include "print32.asm"
|