home *** CD-ROM | disk | FTP | other *** search
- DOSSEG
- .MODEL medium
-
- PUBLIC _BootSec
-
- ;========================================================
- ; Boot sector declaration. The 512 bytes of data
- ; specified by the _BootSec label is a valid boot sector
- ; for a DS/DD 5 1/4" floppy disk. The sector may be
- ; modified for other types of disks by changing the
- ; data in the first declaration part (the "standard disk
- ; data" as described below).
-
- .DATA
-
- VER_HI EQU 1 ;version number, high digit
- VER_LO EQU 0 ;version number, low digit
-
- BOTLOC EQU 7c00h ;location sector is loaded, 0000:BOTLOC
- SECSIZ EQU 512 ;sector size (used only for padding)
-
- ASSUME cs:@DATA, ss:NOTHING
-
- _BootSec LABEL BYTE
-
- ;--- standard disk data
-
- jmp BotRnt
-
- db 'BDISK',VER_HI+'0',VER_LO+'0','0' ;OEM name
-
- dw 512 ;bytes per sector
- db 2 ;sectors per cluster
- dw 1 ;reserved sectors
- db 2 ;number of FATs
- dw 112 ;root directory entries
- dw 720 ;total sectors
- db 0fdh ;media descriptor
- dw 2 ;sectors per FAT
-
- dw 9 ;sectors per track
- dw 2 ;number of heads
- dw 0 ;number of hidden sectors
-
- ;--- non-standard data (offset BOTLOC + 1eH)
-
- dw 40 ;number of tracks
- dw 40 ;sectors used by directory
-
- db 32 DUP (?) ;reserved
-
- ;--- local data (offset BOTLOC + 42H)
-
- db 13,10
- db 'BDISK Library Format ',VER_HI+'0','.',VER_LO+'0',13,10
- db 'By Eric Tauck [72457,1557]',13,10
- db 13,10
- db 'Non-System disk or disk error',13,10
- db 'Replace and strike any key when ready',13,10
- db 13,10
- db 0
-
- ;=== boot routine
-
- BotRnt: sub ax, ax
- mov ds, ax
- cli
- mov ss, ax
- mov sp, BOTLOC
- sti
-
- mov bl, 07h ;foreground color (probably unnecessary)
- mov si, BOTLOC+42H ;start of message
-
- Btrt1: lodsb ;get next byte
- or al, al ;check if done
- jz Btrt2
-
- push si
- mov ah, 14 ;function number
- int 10h ;display character
- pop si
- jmp Btrt1
-
- Btrt2: sub ah, ah ;function number
- int 16h ;wait for key
-
- int 19h ;redo bootstrap
-
- Datend LABEL BYTE
- db ((OFFSET _BootSec + SECSIZ) - OFFSET Datend) DUP (0)
-
- END
-