Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!sdd.hp.com!ucsd!ames!uhccux!webb From: webb@uhccux.uhcc.Hawaii.Edu (Thomas Webb) Newsgroups: comp.lang.pascal Subject: Re: Timing in Turbo Pascal Message-ID: <10099@uhccux.uhcc.Hawaii.Edu> Date: 31 Oct 90 18:51:11 GMT References: <2280@oucsace.cs.OHIOU.EDU> <5307@crash.cts.com> <1308@manta.NOSC.MIL> Reply-To: webb@uhccux.UUCP (Thomas Webb) Distribution: na Organization: University of Hawaii Lines: 40 In article <1308@manta.NOSC.MIL> north@manta.nosc.mil.UUCP (Mark H. North) writes: >In article <5307@crash.cts.com> nkraft@crash.cts.com (Norman Kraft) writes: >> >>Before you start this project, look at Abrash's "Zen of Assembly Language". >>In the first several chapters he developes an assembler routine which does >>not depend on the BIOS, but uses timer chips in a very efficient and >>accurate way. The "ZenTimer", as it is called, achieves a resolution >>of 1 microsecond (1 millionth of a second), and uses the 8253. Abrash >>uses it to time 4 cycle assembler routines: a serious challenge, that! >> >I find this hard to believe (microsecond accuracy). There are hardware >interrupts going on at unpredictable times so unless you take over the >whole machine (memory refresh and all...) how can you be assured of accuracy >in your timer function? > >Mark > Quite right. Abrash actually develops two timers in his book. The higer accuracy timer rerquires you to turn off all interupts. Its primary purpose is to time small sections of assembly code. For timing full programs Abrash has a long term timer of more questionable accuracy. However, it is still a book that anyone with more than a passing interest in assembly should read. It is the last in a series of books editied by Jeff Dunteman (sp?). If you are considering learning assembly you might look at this series. good luck, -tom . . . -- =============================================================================== webb@uhccux.uhcc.Hawaii.edu "The first duty in life is to assume a pose. What the second is, no one has yet discovered." -Oscar Wilde