如何测试软硬盘驱动器参数(2)
2015-06-23 01:00
导读:3.磁盘参数区 表1为一130mm1.2MB的软盘驱动器参数信息(共32字节长度)。 @@08a08600.GIF;表1@@ 4.测试驱动器源码(程序1) 程序1: ;------------ ;CheckDriveType ;Input:AL=Canbe
3.磁盘参数区
表1为一130mm 1.2MB的软盘驱动器参数信息(共32字节长度)。
@@08a08600.GIF;表1@@
4.测试驱动器源码(程序1)
程序1:
;------------
; Check Drive Type
;Input: AL=Can be any drive letter(A,B,C..)
;Output: CF=0 Successfully
; AL=drive type will be returned as an
; ERRORLEVEL.
; DS∶DX=Pointer to parameter block
; CF=1 Failed
; all registers restored.
;-----------------
; ERRORLEVEL Result
; --------------
; -1Drive isn′t local
; 0320K/360K 130mm.drive
; 11.2M 130mm.drive
; 2720K 90mm.drive
; 3Single-density 203mm.drive
; 4Double-density 203mm.drive
; 5Hard disk
; 6Type drive
; 71.44M drive
; 8Something else
;------------;
What-drv proc near
push cx ;save registers
push bx
mov bl,al
and bl,lfh ;bl=0,1,2..
mov ax,4409h
;Check workstation /server
push bx
int 21h
pop bx
jb What-error ;Error to exit
test dh,10h ;test server?
jz What-continue
mov al,-1
jmp short What-Exit
What-continue:
mov ax,440dh
mov cx,0860h
;Get device paramters
push cs
pop ds
mov dx,offset Device-params
int 21h
jb What-error ;Error to exit
mov al,[Device-Params+1]
;Get device type
What-Exit:
clc ;Successfully flag
What-error:
pop bx ;recover registers