Re: A83: Re: A83


[Prev][Next][Index][Thread]

Re: A83: Re: A83




Might want to dec bc somewhere in there :P


In a message dated 1/23/00 2:41:12 AM Eastern Standard Time, david@acz.org 
writes:

> The interrupt occurs around 175-180 times a second (at least on the 85/86,
>  even though it's documented at being around 200), so you can use that to
>  delay a program for a fairly accurate period of time.  The HALT instruction
>  causes the CPU to go into low power mode until an interrupt occurs.  The
>  only two that can occur are the timer interrupt and the on key interrupt.
>  So some code like this will work:
>  
>  DelaySecs = 2
>  DelayTicks = 180
>  
>  Delay:
>   ld bc,DelaySecs * DelayTicks
>  @wait:
>   halt
>   ld a,b
>   or c
>   jr nz,@wait
>   ret
>  



----
Jonah Cohen
<ComAsYuAre@aol.com>
http://linux.hypnotic.org/~jonah/ (down)