如何测试软硬盘驱动器参数
;Output: CF= 0 successfully
;AX= Fdisk size(Hex)
;CX= Number of Cylinders
:DL= Number of Sectors
;DH= Number of Heads
;CF= 1 failed
;-------------
Get-Fdiskparamproc near
cmp al,80h ;test Fdisk ID
jb Get-FdiskExit
mov cx,cs
mov ds,cx
mov es,cx ;set DS,ES segment
mov dl,al ;Fdisk ID
mov bx,offset Partition-area
mov cx,1
mov dh,0
mov ax,201h ;read partition sector
int 13h
jb Get-FdiskExit ;failed to exit.
mov bx,offset Partiton-area+1beh
mov al,[bx+8] ;Sector counter
mov ah,[bx+5] ;Head counter
mov dl,[bx+7] ;cylinder lower
mov dh,[bx+6] ;cylinder high
mov cx,6
shr dh,cl
inc dx ;get cylinder
push dx ;save cylinder
push ax ;save head & sector
mul ah ;compute Fdisk size
mul dx
mov cx,11
Loop-shift:
shr dx,1
rcr ax,1
loop Loop-shift ;Get Fdisk size
pop dx ;sectors & heads
pop cx ;cylinder counter
clc ;clear CF flag
Get-FdiskExit:
retn
Get-FdiskParamendp
Partition-area db 512 dup(0) ;read Partition buffer
Tags:
作者:佚名评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论