Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!xanth!ames!haven!adm!xadmx!kirsch@braggvax.arpa From: kirsch@braggvax.arpa (David Kirschbaum) Newsgroups: comp.lang.pascal Subject: Re clock address Message-ID: <17776@adm.BRL.MIL> Date: 12 Dec 88 14:41:28 GMT Sender: news@adm.BRL.MIL Lines: 19 Andy Perrin (cdp\!ipis) asks how to access the clock register in Turbo Pascal 3.1 to get an integer seed for a random sequence generator. Well, I'd suggest using the DOS master clock count, stored at 0000:046C (hex). It's stored as two 2-byte words .. actually a long integer. Being a long, the low word is at 46C, and the high word at 46E. Just define a typed variable: VAR tick : INTEGER Absolute $0000:$046C; and you got it! Be warned: it only changes every 18th of a second. And I seem to recall some ATs didn't properly update it or something? I believe the ATs have a realtime clock somewhere you can access .. but I don't have any data immediately at hand on that. (Something about the CMOS?) I know I have some code on that .. but maybe the DOS clock tick will do for you. Regards, David Kirschbaum Toad Hall kirsch@braggvax.ARPA