his book demostrates the usage of file and disk I/O function. The program is reading the
boot sector of drive C: and is writing its content to a file. For reading the boot sector
direct disk access is required. DOS offers a function to directly read sectors on INT 25h.
For writing the data to a file standard DOS file function are being used.
Reading the boot sector
his program has hard-coded all of its parameters. Other drives can be accessed by
changing the AL value in the main procedure. Other sectors can be read by changing DX:CX.
;Author : Daniel, Master Sourcerer at Kitana's Cas...
;Last change: June 5, 1998
;Email : email@example.com
;Reads the boot sector of the first hard disk partitio...
;and writes it to the file BOOTSEC.BIN
;Init data segment
MOV AX,SEG data
;Read boot sector
MOV AL,2 ;drive C:
MOV CX,0 ;read first sector
;Write sector to file