"In the land of the blind, the one-eyed man is king"
MSDOS 6.2 Master Boot Record
7C00 START CLI
7C01 XOR AX,AX ; AX=0000
7C03 MOV SS,AX ; SS=0000
7C05 MOV SP,7C00 ; SP=7C00 (start)
7C08 MOV SI,SP ; SI=7C00 (start)
7C0A PUSH AX
7C0B POP ES ; ES=0000
7C0C PUSH AX
7C0D POP DS ; DS=0000
7C0E STI ; Disable interrupts
7C0F CLD ; Set direction flag=inc.
7C10 MOV DI,0600
7C13 MOV CX,0100
7C16 REPNZ
7C17 MOVSW ; Relocate the MBR from
; 7C00 to 0600. Copy the
; first 256 bytes of the
; MBR. This copies a few
; extra bytes at the end
; just in case. The boot
; sector will be later
; loaded at location 7C00.
7C18 JMP 0000:061D ; Basically jumping to
; 7C1D at new loc. 061D.
7C1D MOV SI,07BE
7C20 MOV BL,04
7C22 CMP BYTE PTR [SI],80
7C25 JZ 7C35
7C27 CMP BYTE PTR [SI],00
7C2A JNZ 7C48
7C2C ADD SI,+10
7C2F DEC BL
7C31 JNZ 7C22
7C33 INT 18
7C35 MOV DX,[SI]
7C37 MOV CX,[SI+02]
7C3A MOV BP,SI
7C3C ADD SI,+10
7C3F DEC BL
7C41 JZ 7C5D
7C43 CMP BYTE PTR [SI],00
7C46 JZ 7C3C
7C48 MOV SI,068B
7C4B LODSB
7C4C CMP AL,00
7C4E JZ 7C5B
7C50 PUSH SI
7C51 MOV BX,0007
7C54 MOV AH,0E
7C56 INT 10
7C58 POP SI
7C59 JMP 7C4B
7C5B JMP 7C5B
7C5D MOV DI,0005
7C60 MOV BX,7C00
7C63 MOV AX,0201
7C66 PUSH DI
7C67 INT 13
7C69 POP DI
7C6A JNB 7C78
7C6C XOR AX,AX
7C6E INT 13
7C70 DEC DI
7C71 JNZ 7C60
7C73 MOV SI,06A3
7C76 JMP 7C4B
7C78 MOV SI,06C2
7C7B MOV DI,7DFE
7C7E CMP WORD PTR [DI],AA55
7C82 JNZ 7C4B
7C84 MOV SI,BP
7C86 JMP 0000:7C00
7C8B DB 'Invalid partition table',0
7CA3 DB 'Error loading operating system',0
7CC2 DB 'Missing operating system',0