Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!uwvax!uwmacc!uwmcsd1!marque!gryphon!crash!paul From: paul@crash.cts.com (Paul Palacios) Newsgroups: comp.sys.ibm.pc Subject: Re: Help with delay funct for MSC Message-ID: <2068@crash.cts.com> Date: Wed, 2-Dec-87 13:15:12 EST Article-I.D.: crash.2068 Posted: Wed Dec 2 13:15:12 1987 Date-Received: Sun, 6-Dec-87 08:46:40 EST References: <9394@shemp.UCLA.EDU> <2056@crash.cts.com> <2120@dasys1.UUCP> Reply-To: paul@crash.CTS.COM (Paul Palacios) Distribution: na Organization: Crash TS, El Cajon, CA Lines: 41 Keywords: sleep function, tic, DELAY routine for MS-C In article <2120@dasys1.UUCP> manes@dasys1.UUCP (Steve Manes) writes: > > >void ticks(snooze) >long snooze; /* make this a long for longer delay values */ >{ > unsigned count; > > while (snooze--) { > count = peek(0x40, 0x6C); > while (count == peek(0x40, 0x6C) ); > } >} This approach is fine and yes much simpler, however, keep in mind that the value can roll over and cause problems. Also, I may be wrong, unless it a macro or some thing, but I don't recall a peek function in MSC. Now I'm only really familiar with MSC 3.xx and I could see something to the effect: #define TPD 0x1800b0 /* Tics per Day */ void tsleep(tics) long tics; { long far *timer; long start_time, t; FP_SEG(timer) = 0x40; FP_OFF(timer) = 0x6c; start_time = *timer; while ( ((t = *timer - start_time) >= 0 && t < tics) || (t < 0 && (t - TPD + *timer < tics)) ) ; } ---- ---- -- Paul Palacios UUCP: {cbosgd, hplabs!hp-sdd, sdcsvax, nosc}!crash!portnoy!paul POBox 842,(CA) INET: paul@portnoy.cts.com VOICE: wk:(619)458-0230 Bonita, 92002 ARPA: crash!portnoy!paul@nosc.mil hm:(619)420-5776