shadeos/learning/old_src/16bit/disk_boot.asm

28 lines
568 B
NASM

[org 0x7c00]
mov bp, 0x8000 ; set stack somewhere far away
mov sp, bp
mov bx, 0x9000 ; es:bx = 0x0000:0x9000 = 0x09000
mov dh, 2 ; read 2 sectors
; bios sets dl for disk number
call disk_load
mov dx, [0x9000] ; get first loaded word, 0xdada
call print_hex
call print_nl
mov dx, [0x9000 + 512] ; first word from second loaded sector, 0xface
call print_hex
jmp $
%include "print.asm"
%include "print_hex.asm"
%include "disk.asm"
times 510 - ($-$$) db 0
dw 0xaa55
; boot sector passed, now its sector 2
times 256 dw 0xdada ; sector 2
times 256 dw 0xface ; sector 3