Re: dos wait loop
- Posted by "Kat" <gertie at visionsix.com> Apr 01, 2005
- 466 views
On 31 Mar 2005, at 18:27, Derek Parnell wrote: > > > posted by: Derek Parnell <ddparnell at bigpond.com> > > Tone =8Akoda wrote: > >=20 > > jacques desch=EAnes wrote: > > >=20 > > >=20 > > > maybe this code I wrote in 1996 could help you with delay smaller tha= n 1 > > > second. just call delay() like you would call sleep() > >=20 > >=20 > > it doesn't seem to work right: task manager shows 100% CPU usage. > >=20 > > what i basically need is doEvents() version for dos. some asm command? = i was > > searching web, maybe asm hlt ? > >=20 > > MS-DOS is not designed to know that other programs may also be running at= the > same time. What are you trying to achieve by 'waiting'? > > Anyhow, if you really must, I recommend trapping INT 1C, and when you > want to 'wait', just count the appropriate number of ticks (65535 per hou= r) and > when not waiting, just ignore the interrupts. Right, this was the basis for making multitasking dos OSs. Just trap the= clock and save cpu registers, and load the registers saved from the next= shell to execute in. This method works fine on the Commodore 64. Kat