98 Chapter 2: TI-83 Plus Specific Information
TI-83 Plus Developer Guide Third Release May 28, 2002
Example two:
In the following example, the routine in the above example is used to create a loop that
checks for key input and also for a one byte command to be sent over the link port.
IO_Key_Lp:
RES indicOnly,(IY+indicFlags) ; key scan turned on
EI
HALT ; low power sleep mode
;
B_CALL GetCSC ; check for Scan Code on
; wake up
;
CP SkEnter ; jump if enter key
JR Z,HaveEnterKey
;
CALL haveIOcmd ; check for link
JR NZ,keylp1st ; jump if no byte sent
;
JP LinkCmdSent ; link command received
;
Example three:
This sample routine will attempt to send the register pair HL over the link port. RET
Z = 1 if successful, else Z = 0.
sendHl:
LD A,H ; send H first
PUSH HL ; save L
CALL sendbyte ; send to other side
POP HL
RET NZ ; return if failed
LD A,L ; time to send L
;
sendbyte:
DI
PUSH AF
LD A,D0HD1H ; set both data lines to high,
; free
OUT (bport),A
POP AF
SET indicOnly,(IY+indicFlags)
;
AppOnErr linkfail ; See Example 1
B_CALL SendAByte ; system routine to send byte
JR endexio ; See Example 1