Here is a skeleton Boot Sector you could use.
1. It starts off by switching to the segment offset combination of 07C0:0000 instead of 0000:7C00
2. It updates the DS and ES registers to point to segment 07C0.
3. Finally it makes sure the boot sector signature 0x0AA55 is put at offset 510.
_Text SEGMENT PUBLIC USE16
org 0
; Program entry point
; Currently we are at 0:7C00
; Would have preferred 07C0:0000
; Dealing with an offset that starts at 0 is easier
; So do a far jump to 07C0:????
EntryPoint:
jmp 0x07C0:AfterData
; Your Data goes here!
DUMMY_DATA db 'boot sector data'
; The rest of your code
AfterData:
; update DS to be 7C0 instead of 0
push CS
pop DS
; update ES also
push CS
pop ES
; create stack
mov ax, 0x0000
mov ss, ax
mov sp, 0xFFFF
;************************************************************
; Your code goes here!
;************************************************************
; Make the file 512 bytes long
TIMES 510-($-$$) DB 0
; Add the boot signature
dw 0AA55h
Click here to contact me.
Last updated on 08-November-2002
Back to Boot Sector Main Page