bits 16 ; we're in 16 bit real mode org 0xfe000 ; that's where we're loaded start: ; we jump here after the entry point mov ax, 0xFF push ax pop bx hlt ; fill until the reset vector times 4080 - ($ - start) db 0 ; entry point ; we shouldn't assume any initial state here cli ; set up stack at 0:0x7c00 ; that's just below where we'll load the boot sector mov ax, 0 mov ss, ax mov sp, 0x7c00 ; jump over to start jmp start ; fill the last bytes times 4096 - ($ - start) db 0