Dec 092017
Timer for the AT.
File ATIM.ZIP from The Programmer’s Corner in
Category System Diagnostics
Timer for the AT.
File Name File Size Zip Size Zip Type
ATIM.ASM 7393 2873 deflated
ATIM.COM 400 347 deflated
ATIM.DOC 2291 1177 deflated

Download File ATIM.ZIP Here

Contents of the ATIM.DOC file

PC-AT High Resolution Execution Timer

ATIM is a utility to which will load and execute another program
and report elapsed time using the PC-AT high resolution timer.

This program is both hardware and operating system dependent. It
requires an IBM PC-AT or close clone with a high resolution
timer accessable at port 70h as well as bios support for INT 70h.
As supplied, this program uses the undocumented INT 2Eh back
door entry point into COMMAND.COM for its load & execute
function. For operation under Concurrent Dos 5.0 XM, the CCPM
equate is provided which will enable conditional assembly of
the traditional DOS load & execute function.

My primary reason for writing this program is to distinguish
between alternate assembly language subroutines in programs
which I develop. The high resolution timer generates a tick
1024 times a second as oposed to 18.2 ticks per second with
the low resolution timer. This provides accuracy to 3 decimal
places and minimizes the need to put sequences within repeat
loops in order to time them - after all, a repeat loop can
distort true performance because of its side effect of purging
the pre-fetch queue each time through. And use of the back door
INT 2Eh loader eliminates the masking overhead of loading a new
copy of COMMAND.COM.

But it should be kept in mind that with the high resolution
timer enabled, program execution is slowed down somewhat.
You might try commenting out calls to the DISABLE_70 and
running Norton's SI to get an idea of how much (then reboot).
This is inevitable since the interrupt handler is being called
so often. And to make matters worse, the IBM ROM bios shuts
off the timer after each interrupt requiring the program to
turn it back on again. The CLONE equate has been provided to
skip the reinitialization and should be set TRUE if your bios
is less ill mannered than IBM's (works fine on PC's LTD AT).

Most of the code for the high resolution timer was found
squirreled away in a listing published by Greg Weissman in
the March 1986 Dr. Dobbs starting on page 96. The INT 2Eh
technique was grafted in after Ray Duncan's December 1986
column, also from Dr. Dobbs.
Howard Vigorita, NYACC
December 27, 1986

 December 9, 2017  Add comments

Leave a Reply