home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
dskutl
/
fix_disk.arc
/
BOOTCOPY.ASM
next >
Wrap
Assembly Source File
|
1987-03-04
|
3KB
|
86 lines
PAGE ,132
TITLE Copy Disk Boot Record, Version 1.00, 04-Mar-1987
CODE SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:CODE,DS:CODE
ORG 5CH
FCB1 LABEL BYTE
ORG 6CH
FCB2 LABEL BYTE
ORG 100H
START: JMP BEGIN
SIGNON DB "Copy Disk Boot Sector Program, Version 1.00",13,10
DB "SMG Software",13,10
DB "(C) Copyright 1987 Steven Georgiades",13,10,10,"$"
DONE_MSG DB "The Boot Record from Drive x: has been copied to Drive x:!",13,10,"$"
ERR_DRV DB "Invalid Drive Letter!",7,13,10,"$"
ERR_RD DB "Error Reading Boot Record from Source!",7,13,10,"$"
ERR_WR DB "Error Writing Boot Record to Destination!",7,13,10,"$"
SRC_DRV DB ?
DST_DRV DB ?
BEGIN: PUSH AX ; Save Drive Validity Info
MOV AH,9 ; Output Sign-On Message
MOV DX,OFFSET SIGNON
INT 21H
POP AX ; Restore Drive Validity Info
CMP AX,0 ; If Invalid,
JE DRV_OK
DRV_ERR: MOV DX,OFFSET ERR_DRV ; Setup Pointer to Error Msg
ERR_OUT: MOV AH,9 ; Output Error Message
INT 21H
MOV AX,4C01H ; Exit to DOS (Return = 1)
INT 21H
DRV_OK: MOV AL,FCB1[0] ; Read Source Drive Number
DEC AL
JS DRV_ERR ; If Default,
MOV SRC_DRV,AL ; Convert Drive Number to Letter
ADD AL,'A'
MOV DONE_MSG[27],AL
MOV AL,FCB2[0] ; Read Source Drive Number
DEC AL
JS DRV_ERR ; If Default,
MOV DST_DRV,AL ; Convert Drive Number to Letter
ADD AL,'A'
MOV DONE_MSG[55],AL
MOV AL,SRC_DRV ; Read Source Boot Record
MOV BX,OFFSET FATBUF
MOV CX,1
MOV DX,0
INT 25H
JNC RD_OK
POPF
MOV DX,OFFSET ERR_RD
JMP ERR_OUT
RD_OK: POPF
MOV AL,DST_DRV ; Write Destination Boot Record
MOV BX,OFFSET FATBUF
MOV CX,1
MOV DX,0
INT 26H
JNC WR_OK
POPF
MOV DX,OFFSET ERR_WR
JMP ERR_OUT
WR_OK: POPF
MOV AH,9
MOV DX,OFFSET DONE_MSG
INT 21H
MOV AX,4C00H
INT 21H
FATBUF LABEL WORD
CODE ENDS
END START