A83: Re: A83


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

A83: Re: A83




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

> How do you delay a program for a couple of seconds without having to press
a
> key in TI83 Z80 Assembly?




References: