Newsgroups: comp.os.msdos.djgpp From: manni DOT heumann AT gmx DOT de (Manni Heumann) Subject: Re: How to get bios timer tick count? References: <8cg55n$1kl$1 AT mailint03 DOT im DOT hou DOT compaq DOT com> <38EB9E19 DOT FDEEB2C4 AT corel DOT com> X-Newsreader: News Xpress 2.01 Date: Thu, 06 Apr 2000 07:40:16 GMT NNTP-Posting-Host: dhcp33-226.uni-bielefeld.de Message-ID: <38ec3f64$1_1@news.uni-bielefeld.de> X-Trace: 6 Apr 2000 09:40:20 +0200, dhcp33-226.uni-bielefeld.de Lines: 35 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "pwillard" wrote: > >Actually, I'm not too afraid of straight C code, but accessing BIOS >information as in the FAQ >made me very cautious. I'm not sure how to access the rom bios area to >perform what the old pascal >code was doing. > >Here is the snippet of Pascal: > >TICK := LONGINT(PTR($40, $6C)^); {GET ROM BIOS TIMER TICK COUNT} > > Should I be more creative when accessing the system as done in the example? >I mean, what's the magic? > >I know that the 8253/8254 uses a 4 byte area located at 0040:006C >(segment:offset notation) for >incrementing a counter and that's exactly what the code above does. > >I want to snap shot the counter, and compare it's value to a snap shot later >for speed calibration. I >just don't understand yet how to tell DJGPP to do this without whacking the >system into oblivion. > >Pete >(Who's afraid to touch memory directly after reading the FAQ. ) It's not that bad. Of course it's different with a 16 bit compiler, pascal, c or whatever. I suggest you read the far pointer intro at http://www.delorie.com/djgpp/doc/ug/dpmi/farptr-intro.html -- Manni