home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
ddjmag
/
ddj8603.arc
/
WEISLST1.MAR
< prev
next >
Wrap
Text File
|
1986-03-31
|
4KB
|
111 lines
;--------------------------------------------;
; Weissman/Dr. Dobbs submission Listing 1: ;
; Assembler BIOS diskette read test program. ;
;--------------------------------------------;
;----------------------------------------;
; Assembler code to test diskette times, ;
; reading 16 tracks through INT 13. ;
; 10/1/85 Gregg Weissman ;
; E-X-E Software Systems ;
;----------------------------------------;
HI_RES_TIMER equ 1
; Set this to 1 if you implement
; the 1024 tick/sec AT timer.
; It will return time in 1k'ths of
; a second. If using the usual IBM
; 18.2 ticks per second timer, set to 0
; and receive counts at that rate.
if HI_RES_TIMER
GET_TIME equ 10h ; Define the proper AH function value
; For int 1ah
else
GET_TIME equ 0
endif
;----------------------------------------;
; Start the test code: ;
;----------------------------------------;
CODE segment
assume cs:code,ds:code,es:code,ss:code
org 80h
TIME_LO dw ? ; Time accumulator out of the way.
TIME_HI dw ?
org 100h
START: ;------------------------------------------;
; First, read a dummy sector to start the ;
; diskette: this way motor start time will ;
; not affect the timings. ;
;------------------------------------------;
mov ax,0201h ; Read, 1 sector.
mov cx,1 ; Starting @ track 0, sector 1
mov dx,1 ; Side 0, diskette B:
mov bx,offset DATA_AREA
int 13h ; Perform the op.
jb STOP ; Error: abort.
;----------------------------------------;
; Now, get the time of day and perform ;
; the test. Read 32 tracks, 16 cyl's. ;
;----------------------------------------;
cli
mov ah,GET_TIME
int 1ah
mov TIME_LO,dx
mov TIME_HI,cx
sti
xor bp,bp ; Set a register to count reads.
mov di,290 ; number of sectors total in testfile.
mov dx,1 ; disk B:
mov cx,0001 ; Start at trk 0, sect 1
mov bx,offset DATA_AREA
SIDE_1:
mov al,9
cmp di,al ; Number not mod 9, might do partial
jnb N2 ; read on last track.
mov ax,di ; Move partial read value into al
N2:
mov ah,2 ; Read disk function code into AH
int 13h ; Perform disk read.
jb STOP ; Error: don't bother with re-try.
sub di,9 ; Subtract default count of sectors.
jbe DONE ; We're done if di <= 0
inc bp ; Count the op. to verify number done.
xor dh,1 ; Flip sides.
jne SIDE_1 ; If we flipped to side 1, do it.
inc ch ; else bump to next track (cylinder)
jmp SIDE_1 ; and go back for more.
DONE:
mov ah,GET_TIME ; OK, stop the clock.
int 1ah
sub dx,TIME_LO ; Get end_time - Start_time.
sbb cx,TIME_HI
STOP:
; WARNING!
; This program does not return to DOS!
; Do not run this except under DEBUG!
int 3 ; DEBUG breaks here, read time in DX
; BP=20h and Carry Clear if no errors.
org 200h
DATA_AREA label byte
CODE ends
end START