LZ: TimeOut routines


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

LZ: TimeOut routines



Can any of you tell me how I would run a timeout routine in a program (such 
as having the calculator turn itself off if a key wasn't pressed in after 
a certain amount of time)?  I can't seem to get it to work correctly!

This is about what I've tried so far:

ld  bc, $ffff
Loop:
call GET_KEY
dec bc
jr  z, Time_Out
or  a
jr  z, Loop
ret

Time_Out:
(just some other stuff)

Can any of you give me a hint?  I also tried to push bc while it was $ffff, 
then pop it each time the regular bc=0, check it to see if it was zero.  If 
not, I decreased it, pushed it, loaded $ffff into bc, and returned to the 
loop.  Maybe I was just using incorrect syntax in the commands I used, but 
please give me ideas!

Thanks,
Michael Wyman - SeaHorse Software
wyma0012@gold.tc.umn.edu




Follow-Ups: