Re: LZ: Mazemania and delay


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

Re: LZ: Mazemania and delay



Carl Wang wrote:
> 
> were bad.  Second, how do you do delays in asm.  I tried NOP but it took
> about 3 billion of them to get it to pause for 1 second.  Well, thanks
> yet again!


hahahahaha... oops sorry :-)


You use HALT. Halt delays the program until an interrupt is called.
Luckily
there is one interrupt that are called 200 times/sec, so if you want to
wait one second you do like this:


 ld b,200
WaitSec:
 halt
 djnz WaitSec


Of course you could remove halt and just loop around a couple of times,
but
you have to loop pretty much then.
Another thing, if you've disabled the 200hz interrupt with DI, the calc
will
freeze until you press on, because then another interrupt is called.




-----------------------------------------------------------------------------
| Real name: Jimmy Mårdell              | "From a heaven
descent              |
| Email....: mailto:mja@algonet.se      |  A suicidal
dissident               |
| IRC-name.: Yarin                      |  My power is
omnipotent             |
| WWW......: http://www.algonet.se/~mja |  Demigod, king and president"
- CRD |
|-----------------------------------------------------------------------------|
|          "I'm the operator with my pocket calculator" -
Kraftwerk           |


-----------------------------------------------------------------------------


References: