rdos/boot/mbr.asm

53 lines
621 B
NASM
Raw Normal View History

cpu 8086
2020-04-30 20:22:14 +02:00
%define seg 0x060
org 0x7C00 - (seg << 4)
init: cli
mov ax, seg
mov ds, ax
mov es, ax
mov ss, ax
xor sp, sp
mov ax, sp
push ax
2021-02-18 20:38:42 +01:00
.retry: mov ax, 0x0208
mov cx, 2
mov dh, 0
mov bx, 0x100
int 0x13
jc .retry
xor di, di
mov ax, 0x18CD
stosw
int 0x12
mov cl, 6
shl ax, cl
stosw
mov al, 2
stosb
mov ax, 0x18CD
stosw
jmp seg:0x100
times (0x1BE - ($-$$)) db 0
; assumes 16 heads, 63 sectors per track
; image of 1.44 MB floppy starting on 2nd track
part1: db 0x80
db 1, 1, 0
db 1
db 0xFF, 0xFF, 0xFF
dd 63
dd 0xb40
times (0x1FE - ($-$$)) db 0
; Boot signature
sig: dw 0xAA55