Re: A86: calc auto off
[Prev][Next][Index][Thread]
Re: A86: calc auto off
In a message dated 12/20/99 7:44:33 PM Eastern Standard Time,
walkingmantis@hotmail.com writes:
> I have been wondering if there was a routine that would automatically turn
> the screen off in an asm program if the keys haven't been pressed for x
> amount of time. I've seen a few routines, but i need them to work while
the
> calc is looking for a key press, eg. a password. I really need this in my
> program because if you accidentally turn the calc on when it asks for a
pw,
> and you put it away while the screen is on, the program will stay on and
the
>
> batteries will be the innocent victims. Anyway if anyone can help me out
it
> would be really appreciated.
>
Just have your getkey loop in a timer, like so:
getkey:
ld bc,1000 ;timer
waitkey:
halt
call _getcsc
or a
ret nz ;key pressed
dec bc
ld a,b
or c
jr nz,waitkey
ld a,1
out (3),a ;turn off calc
halt
ld a,11
out (3),a ;turn back on
jr waitkey
----
Jonah Cohen
<ComAsYuAre@aol.com>
http://linux.hypnotic.org/~jonah/ (down)