Texas Instruments TI-83 Plus Manual page 76

Third release
Hide thumbs Also See for TI-83 Plus:
Table of Contents

Advertisement

66
Example two: This example will stay in a loop and make calls to read key, which will
return:
Z = 1 if no key found, Z = 0 if a key is detected,
ACC = scan code of key, 0 = É key
run indicator will be running, and
allow APD.
ex_2:
KeyLoop:
;
; this part of the loop could be modifying the screen with
; animation of some kind, or doing other work while waiting for a key to
; be input.
;
;
; here we have a key press, ACC = scan code, 0 = on key
;
;
;
; check for rest of keys that matter
;
;
;
readkey:
;
notOnkey:
TI-83 Plus Developer Guide
B_CALL
RunIndicOn
SET
apdAble,(IY+apdFlags)
RES
onInterrupt,(IY+onFLags)
CALL
readKey
JR
Z,KeyLoop
OR
A
JP
Z,Handle_On_Key
CP
skEnter
JP
Z,Handle_Enter_key
RES
indicOnly,(IY+indicFlags)
EI
CALL
GetCSC
BIT
onInterrupt,(IY+onFlags)
JR
Z,notOnkey
LD
A,0
RET
OR
A
RET
Chapter 2: TI-83 Plus Specific Information
; turn on run indicator
; turn on APD
; reset On key flag
; see if key pressed
; jump if no key found
; is it the on key ?
; jump if yes
; enter key scan code ?
. . .
; make sure keys are
; scanned
; turn on interrupts
; local routine to look
; for scan code
; On key pressed
; scan code for on key,
; Z = 0 from test
; any scan code found
; Z = 1 if no key, else
; Z = 0
Third Release May 28, 2002

Advertisement

Table of Contents
loading

Table of Contents