Re: A85: Timer


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

Re: A85: Timer



You won't be able to get accurate timing like that.  If you want to
get timing, use the "halt" instruction.  An interrupt occurs on the 85
200 times in a second.  so,

ld b,200
Loop:
  halt
  djnz,Loop

will pause for one second.  The best way to do what you want though is
to use an interrupt.  If you are programming for Usgard, look up how
to install an interrupt.  it is very simple and much better than the
above method.

-mike pearce

On Tue, 19 Aug 1997 02:51:50 -0400 (EDT), you wrote:

>I am trying to make my program pause and wait for a key for about 10 seconds
>and then move on if that key wasn't pressed, but I am not exactly sure about
>what to do.
>Please help me out.
>
>ld     bc,1000
>Loop:
>call   GET_KEY
>cp     K_EXIT
>jr       z,Pressed
>djnz  Loop
>Pressed:
>call CLEARLCD
>...
>
>That should work right? But what number do I need to put in bc to equal 10
>seconds?
>
>Thanks,
>Mikel Blanchard
>
><A HREF="http://members.aol.com/CashOnly/The_Layer.html">http://members.aol.co
>m/CashOnly/The_Layer.html</A>
>


References: