; Disassembly of file :FPHD.COM ; ; Define common ASCII control codes. ; HT EQU 9 LF EQU 10 FF EQU 12 CR EQU 13 EOF EQU 26 ; ; Define MSDOS/PCDOS functions. ; _OUTSTR EQU 9 _TSR EQU 49 ; ; Macro to generate MSDOS/PCDOS calls. ; MSDOS MACRO name IFDEF &name MOV AH,&name ENDIF INT 21H ENDM ; Code_Seg SEGMENT PUBLIC L0005H EQU 00005H L0008H EQU 00008H L0300H EQU 00300H L0A0DH EQU 00A0DH L2513H EQU 02513H L3513H EQU 03513H L4C00H EQU 04C00H Code_Seg ENDS ; ; Code_Seg SEGMENT PUBLIC ; ASSUME CS:Code_Seg,DS:Code_Seg ORG 00100H L0100H: JMP SHORT L013AH L0102H: DB 0,0 ; put address of real int 13h here L0104H: DB 0,0 L0106H: CMP DL,3 ;INT 13H comes here first now JBE L0135H ;0-3 means floppy CMP AH,4 ;function 4 is verify JNZ L011AH CMP CX,1 ;cylinder 0, sector 1 JNZ L011AH CMP DH,0 ;head 0 JZ L012EH ;don't let it mess with part. tb L011AH: CMP AH,0BH ;is it write ECC? JZ L012EH ; yes, then error CMP AH,5 ;is it format cylinder? JZ L012EH L0124H: CMP AH,6 ;is it format bad cylinder? JZ L012EH CMP AH,7 ;is it format starting at CL JNZ L0135H ;not one of these bad ones L012EH: MOV AX,OFFSET L0300H ;set write-protect error return code STC ;Show error on return DB 0CAH ;*** FAR RETURN *** L0133H: DB 0,0 ; ADD AL,BYTE PTR [BX+SI] L0135H: JMP DWORD PTR CS:[L0102H] L013AH: MOV AX,OFFSET L3513H ;Get interupt vector. MSDOS MOV DI,BX MOV DX,BX MOV SI,OFFSET L0106H ;Set far jump to real int 13 MOV CX,OFFSET L0008H REPZ CMPSB ;Compare strings. JZ L0171H ;see if have already installed MOV DI,BX MOV SI,OFFSET L0135H MOV CX,OFFSET L0005H REPZ CMPSB ;Compare strings. JNZ L0189H SUB DX,2FH PUSH DS PUSH ES POP DS MOV AX,OFFSET L2513H ;Set int vector (AL) to DS:DX MSDOS POP DS MOV DX,OFFSET L01ACH MSDOS _OUTSTR ;Display string at (DS:DX). MOV AX,OFFSET L4C00H ;Terminate a process. MSDOS L0171H: ADD DX,2FH L0174H: PUSH DS PUSH ES POP DS MOV AX,OFFSET L2513H ;Set int vector (AL) to DS:DX MSDOS POP DS MOV DX,OFFSET L01F6H L0180H: MSDOS _OUTSTR ;Display string at (DS:DX). MOV AX,OFFSET L4C00H ;Terminate a process. L0187H: MSDOS L0189H: MOV DX,OFFSET L01ACH MSDOS _OUTSTR ;Display string at (DS:DX). MOV WORD PTR [L0102H],BX MOV WORD PTR [L0104H],ES MOV DX,OFFSET L0106H MOV AX,OFFSET L2513H ;Set int vector (AL) to DS:DX MSDOS MOV DX,OFFSET L013AH MOV CL,OFFSET 4 SHR DX,CL INC DX MSDOS _TSR ;Terminate and stay resident. L01ACH: DB CR,LF,'Your hard disk is now Format-protected.',CR DB LF,'Run FPHD again to turn it OFF' DB '.$' L01F6H: DB CR,LF L01F8H: DB 'FPHD is now OFF (no hard disk protection).',CR,LF L0224H: DB 'Run it again to turn it ON.' L023FH: DB '$' L0240H: DB 'Note: the OFF/ON func will not work if you install ' L0274H: DB 'another prog that grabs INT 13 after you' L029BH: DB ' install FPHD.$' L02A9H: DB '10/28/8' L02B0H: DB '5 JKW ' DB 0,0,0,0,0,0 DB 0,0,0,0,0,0 DB 0,0,0,0,0,0 DB 0,0,0,0 L02CEH: DB 0,0 L02D0H: DB 0,0,0,0,0,0 DB 0,0,0,0,0,0 DB 0,0,0,0 L02E0H: DB 0,0,0 L02E3H: DB 0,0,0,0,0,0 DB 0,0,0,0,0,0 L02EFH: DB 0,0,0,0,0,0 DB 0,0,0,0,0,0 DB 0,0,0,0 DB 0 Code_Seg ENDS END L0100H