home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 December
/
simtel1292_SIMTEL_1292_Walnut_Creek.iso
/
msdos
/
sysutl
/
v20timer.arc
/
V20TIMER.ASM
next >
Wrap
Assembly Source File
|
1985-11-02
|
7KB
|
191 lines
;
;
; V20TIMER.ASM
;
; Adapted from "ptimer.asm/cpu.com"
;
; Modified 851028 by COMPUQUEST Inc. to show full, accurate clock speed.
;
;
; This timing loop is constructed to take exactly 10.0 seconds to
; execute when run on a standard pc/compatible using the 8088 micro
; and the standard clock speed of 4.77 Mhz.
;
; The speed gain achieved by using the NEC V20, as can be seen, is
; almost 300%. It should be noted that the V20 gets its advantage
; mainly from its ability to execute instructions in a fraction of
; the normal bus-cycle time taken to do the same instruction with
; an 8088. Therefore, this timing test shows a greater improvement
; than you would see with normal PC use.
;
; Still... a V20 in your PC will make a BIG DIFFERENCE in speed for
; things like spreadsheet recalcs, assemblies, compiles, and other
; tasks where alot of memory moves, calculation instructions etc. are
; going on.
;
; As a good example, that %$*@$ wait needed to run the Memory Check
; when you boot a PC will take only about 1/4 the time !!
;
;
; NOTE: COMPUQUEST Inc. is an electronic engineering Co.
; that designs and develops microprocessor-based
; products; both hardware and software. If you need
; more info, give us a call !!
;
; SPEED UP YOUR PC/COMPATIBLE FOR JUST $19.95 with NEC V20-8!
;
;Only $19.95 from COMPUQUEST Inc. ! In Stock, Same-day Shipment !
;Includes installation instructions. This is an 8 Mhz part!
;
;NEC V20-8 is a direct replacement for 8088 CPU. Just plug in and go.
;Complete compatibility with 8087. Uses only 20% of the power that
;the 8088 draws, and makes your PC run up to 90% --- -- ->FASTER!!
;
;Use your Master Charge, VISA, AMEX, COD or Check.
;Delivery in Illinois, add 7% tax. ($1.40)
;
;Call, write, or pick up Monday - Friday 8:00 / 5:00 at
; COMPUQUEST Inc. 801 Morse Ave. Schaumburg, IL 60193
; 1-800-722-2353 Outside Illinois
; (312) 529-2552 Inside Illinois or for
; Nationwide Technical Info
; NOTE: V30-8 (replaces 8086) also available at $24.95 ea.
;
; Full specification booklet and application notes are available for $5.00
;
;
;
;
;
;
;
;
LF EQU 0AH
CR EQU 0DH
code SEGMENT
ASSUME CS:code,DS:code,ES:code
ORG 100H
start: MOV AH,9
MOV DX,OFFSET banner
INT 21H
MOV AH,2CH
INT 21H
; clocks needed
;--------------------------------------------------
MOV OldSec,DX ; 19 = 19
XOR AX,AX ; 3 = 3
MOV DX,10 ; 4 = 4
outer: MOV CX,47227 ; 4 * 10 = 40
inner: AAM ; 83 * 47227 * 10 = 39198410 ( 1.98 % )
DEC CX ; 2 * 47227 * 10 = 944540 ( 1.98 % )
JNZ inner ; 16 * 47226 * 10 +
; 4 * 10 = 7556200 ( 15.84 % )
DEC DX ; 2 * 10 = 20
JNZ outer ; 16 * 9 +
; 4 = 148
MOV AH,2CH ; 4 = 4
INT 21H
;--------------------------------------------------
; T O T A L = 47699388 + INT GetTime
; or 4.77E+06 * 10
;
; If NEC V-20 is plugged into the PC, with no other changes, (i.e. still
; running 4.77 Mhz), the faster instruction execution time of the NEC V-20
; greatly reduces the routine execution time to only 15980000 clocks
; instead of 47699388. Thus:
;
; "Actual execution time here was 03.35 seconds
; Effective clock speed = 14.23 Mhz"
;
;
;
MOV AX,100
IMUL DH
MOV DH,0
ADD AX,DX ;seconds(after) * 100 [0..5999]
MOV BX,AX
MOV DX,OldSec
MOV AX,100
IMUL DH
MOV DH,0
ADD AX,DX ;seconds(before) * 100 [0..5999]
SUB BX,AX
JNB SameM ;within same minute, no adjustment
ADD BX,6000 ;otherwise add 1 minute
SameM: MOV AX,BX
MOV DifSec,BX
MOV BP,offset ACTsec
MOV BX,1000
CWD
IDIV BX ;dx:ax / 1000
CALL ToASC ;get first digit
MOV BX,100
MOV AX,DX
CWD
IDIV BX
CALL ToASC ;get second digit
INC BP ;skip decimal point
MOV BX,10
MOV AX,DX
CWD
EX: IDIV BX
CALL ToASC ;first digit after decimal point
MOV AX,DX
CALL ToASC ;last digit after decimal point
MOV AH,9
MOV DX,OFFSET EXCmsg
INT 21H
MOV AX,4770
CWD
MOV BX,DifSec
DIV BX
MOV BP,offset EFFclk
;
; PROVIDE FOR TWO DIGITS BEFORE DECIMAL PT.
DIV TEN ;REDUCE AX TO QUOTIENT, REMAINDER
CALL ToASC ;PROCESS QUOTIENT INTO TENS DIGIT
XCHG AL,AH ;PUT REMAINDER INTO AL
;
CALL ToASC ;get one digit
INC BP ;skip decimal point
MOV AX,DX
MOV CX,10
MUL CX ;remainder * 10
DIV BX
CALL ToASC
MOV AX,DX
MUL CX ;remainder * 10
DIV BX
CALL ToASC
MOV AH,9
MOV DX,OFFSET EFFmsg
INT 21H
MOV AH,4CH ;terminate with '$'
INT 21H ;as return code
ToASC proc near
OR AL,30H
MOV [BP],AL
INC BP
ret
ToASC endp
OldSec DW 0
DifSec DW 0
Ten db 0ah
Banner DB ' EXECUTION TIME vs. CLOCK SPEED (minimal RAM access), please wait...'
DB CR,LF,'$'
EXCmsg DB 'Execution time should be 10.00 secs if 4.77 Mhz clock'
DB ' & no WAITs on RAM access',CR,LF,CR,LF,CR,LF,CR,LF,CR,LF
DB 'Actual execution time here was '
ACTsec DB '00.00 seconds',CR,LF,'$'
EFFmsg DB 'Effective clock speed = '
EFFclk DB '00.00 Mhz',CR,LF,'$'
code ENDS
;
END start