Last active
August 14, 2024 01:05
-
-
Save andydude/3c599caa975f62bc886feb1b77133931 to your computer and use it in GitHub Desktop.
First attempt at a master boot record.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[bits 16] | |
[org 0x7C00] | |
start: | |
cli | |
xor si,si | |
mov ss,si | |
mov sp,0x7DBE | |
popa | |
mov es,si | |
mov ax,0x201 | |
int 0x13 | |
jmp 0x0:0x7E00 | |
times 0x1BC - ($-$$) db 0 | |
mbr: | |
dw 0x7E00 | |
dw 0x0180 | |
dw 0x0001 | |
dw 0x7F0B | |
dw 0xFDBF | |
dw 0x003F | |
dw 0x0000 | |
dw 0x40C1 | |
dw 0x005E | |
times 0x1FE - ($-$$) db 0 | |
sig: | |
dw 0xAA55 |
I believe the original purpose was to load a VBR and jump do it.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure about the purpose, but if you ever plan to use this for anything serious, some BIOSes require the first instruction (first 2 bytes) to be "33 C0" ("xor ax, ax", but alternatively encoded) to identify the MBR as "modern" and disable workarounds for old DOS variants. Learned this the hard way with builder-hex0.