Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!imagen!atari!jwt From: jwt@atari.UUCP (Jim Tittsler) Newsgroups: comp.sys.atari.st Subject: Re: DCLOCK & IKBD functions Message-ID: <898@atari.UUCP> Date: Tue, 1-Dec-87 13:29:29 EST Article-I.D.: atari.898 Posted: Tue Dec 1 13:29:29 1987 Date-Received: Sat, 5-Dec-87 12:37:47 EST References: <8711300600.AA16603@ucbvax.Berkeley.EDU> Organization: Atari Corp., Sunnyvale, CA Lines: 35 Summary: ikbd TOD Functions In article <8711300600.AA16603@ucbvax.Berkeley.EDU>, JEMCCABE@MTUS5.BITNET writes: > Can someone PLEASE post to the net about how to use the IKBD > functions? The Abacus ST Internals book tempts me with very specific > descriptions of the keyboard packet structures and IKBD commands, > but never mentions how to get them from the processor! The easiest way to get the time/date from the ikbd is to use the xbios to do it for you. The LONG Gettime() function (xbios(23), and the associated settime() xbios(22)) calls will take care of handling all of the communications with the keyboard for you. The Gettime() call will return the time in the low word with the date in the high word. The time and date will be in TOS format. If you REALLY want to know the least significant bit of the seconds counter you can replace the clockvec pointer that is in the structure returned by the Kbdvbase() (xbios(34)) call. When the "clockvec" code gets control, A0 will be pointing the the ikbd TIME-OF-DAY packet. Your routine should end with an RTS. Once you have installed your routine, the ikbd can be forced to send the time by sending it the INTERROGATE TIME-OF-DAY CLOCK command (0x1c). The easiest way to do that is probably to do Bconout(4,0x1c) bios call, where the 4 refers to the output only KBD device. Be sure to restore the original "clockvec" before your program exits. > I was glancing through ST Peek's and Pokes (in a bookstore) and > it said that the time is returned in addresses 3584 through 3589. > I tested this out, and it didn't seem to work. Hmm... I REALLY would not recommend using those addresses as they will change from one system release to another. (If what you want is a relative timer with more than 2 second accuracy, you might consider using the LONG _hz_200 counter that is incremented at a 200 Hz rate and IS located in "defined" system variable space.) Jim Tittsler, Atari Corp. {ames, portal}!atari!jwt