1
0
Fork 0
mirror of https://git.sr.ht/~asya/copycat synced 2024-09-28 02:08:27 +00:00
copycat/crabbios/crabbios.asm

28 lines
484 B
NASM
Raw Permalink Normal View History

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