也谈硬盘参数测试t2gg
>mov al,byte ptr
and al,1
mov cl,4
shl al,cl
or al,0a0h
mov byte ptr,al
mov dx,1f1h
mov cx,7
mloop3:
lodsb
out dx,al
inc dx
loop mloop3
dec dx
xor cx,cx
mloop4:
in al,dx
and al,10001000b
cmp al,00001000b
jz readdata
loop mloop4
jmp time-out
readdata:
cli
cld
mov dx,1f0h
mov di,offset hdinfo
mov cx,100h
repz insw
sti
mov dx,1f7h
in al,dx
and al,71h
xor al,50h
jnz errend
mov si,offset addr
mov di,offset
add di,4
mov bh,0
mov cx,7
mloop6:
mov bl,byte ptr
mov dx,word ptr
call dec160
inc si
add di,28
loop mloop6
mov ax,1
mov si,offset addr
mov cx,3
mloop7:
mov bl,byte ptr
mul word ptr
inc si
loop mloop7
mov bx,2048
div bx
mov dx,ax
call dec160
mov bx,offset hdinfo
mov si,offset addr1
mov di,offset iofm
mov cx,3
mloop8:
push cx
push bx
add bx,
mov cx,
add si,4
mloop9:mov ax,word ptr
xchg ah,a1
stosb
mov al,ah
stosb
add bx,2
loop mloop9
pop bx
pop cx
add di,23
loop mloop8
mov dx,offset copy
jmp endproc
time-out:
mov dx,offset t-o-msg
jmp endproc
errend:
mov dx,offset errmsg
endproc:
mov ah,09h
int 21h
mov ah,4ch
int 21h
mainendp
end main
本文链接地址:http://www.oyaya.net/fanwen/view/172023.html
and al,1
mov cl,4
shl al,cl
or al,0a0h
mov byte ptr,al
mov dx,1f1h
mov cx,7
mloop3:
lodsb
out dx,al
inc dx
loop mloop3
dec dx
xor cx,cx
mloop4:
in al,dx
and al,10001000b
cmp al,00001000b
jz readdata
loop mloop4
jmp time-out
readdata:
cli
cld
mov dx,1f0h
mov di,offset hdinfo
mov cx,100h
repz insw
sti
mov dx,1f7h
in al,dx
and al,71h
xor al,50h
jnz errend
mov si,offset addr
mov di,offset
nofc
add di,4
mov bh,0
mov cx,7
mloop6:
mov bl,byte ptr
mov dx,word ptr
call dec160
inc si
add di,28
loop mloop6
mov ax,1
mov si,offset addr
mov cx,3
mloop7:
mov bl,byte ptr
mul word ptr
inc si
loop mloop7
mov bx,2048
div bx
mov dx,ax
call dec160
mov bx,offset hdinfo
mov si,offset addr1
mov di,offset iofm
mov cx,3
mloop8:
push cx
push bx
add bx,
mov cx,
add si,4
mloop9:mov ax,word ptr
xchg ah,a1
stosb
mov al,ah
stosb
add bx,2
loop mloop9
pop bx
pop cx
add di,23
loop mloop8
mov dx,offset copy
jmp endproc
time-out:
mov dx,offset t-o-msg
jmp endproc
errend:
mov dx,offset errmsg
endproc:
mov ah,09h
int 21h
mov ah,4ch
int 21h
mainendp
end main
《也谈硬盘参数测试t2gg(第2页)》