[A83] Re: Interupts on TI-83 Plus
[Prev][Next][Index][Thread]
[A83] Re: Interupts on TI-83 Plus
Use the romcall _getcsc to scan for enter, instead of direct input. Just
bcall it and compare A with 9 to see if enter was pressed.
(the halt is there to safe some battery power)
loop:
...
halt
bcall(_getcsc)
cp 9
ret z
jr loop
Or, if you really want to use direct input then disable interrupts with DI.
The problem is that when you use direct input not only you detect the key
press but also the TI-OS. So, your program returns properly to the TI-OS,
but the latter thinks enter has been pressed and not yet been handled,
resulting in executing the last command, which is your program, like when
your program would have returned good and you pressed enter again. If you
used 2nd instead of enter, you would see that 2nd was set when your program
returns.
So, to handle a key press use _getcsc. Or, do use direct input and make sure
the TI-OS can't scan for key presses by disabling interrupts.
Tijl Coosemans
----- Original Message -----
From: "Dale Watson" <merlin@cinternet.net>
To: <assembly-83@lists.ticalc.org>
Sent: Friday, July 27, 2001 4:35 PM
Subject: [A83] Interupts on TI-83 Plus
>
> I am trying to write a program that will stop when you press the enter
key.
> The problem was that this would restart the program as soon as it gave
> control to TI-OS. I tried to solve this problem by telling it to search
for
> the enter key being pressed and then released before giving control to
> TI-OS. This didn't seem to do anything. I think it might be the
interupts.
> Does anyone know what all the interupts are on the TI-83 Plus?
>
> Scot
>
>
>
>
References: