Re: A82: Port 1, the keyboard port.


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

Re: A82: Port 1, the keyboard port.



ryan.gillespie@juno.com (Ryan N Gillespie) writes:
>GSGolfNut@aol.com writes:
>
>>Tell me if this routine for checking the keyboard port is correct.
>>	<snip>
>
>Alrighty, I needed to figure this out myself, so I made a simple 
>program to test the keyport.

Sorry about this, I forgot to include the Clear Buffer Routine for
Port1.asm


CLR_GBU:			;Clear GRAPH_MEM
 LD HL,$88B8
 LD DE,$88B9
 LD BC,$2FF
 LD (HL),0
 LDIR
 RET


>Begin File: Port1.asm
>;=-=-==-=-=-=-=-==-=-=-=-=-==-=-=-=-=-==-=-=-=-=-==-=-=-=-=-=
>; Test Port 1
>; Displays bits of returned value from Port 1 at the top left.
>; * WARNING!!! There is *NO WAY* to exit this program!!!
>; Written by Scoobie
>
>#include "ti82.h"
>
>.org 0
>
>	ROM_CALL(CLEARLCD) ; Clear Screen
>	CALL_(CLR_GBU)     ; Clear GRAPH_MEM (buffer)
>Loop:
>	jr KeyPress	   ; KeyPress Routine
>
>Loop2:
>	CALL_(CLR_GBU)	   ; Clear GRAPH_MEM (buffer)
>	jr Loop
>
>
>;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>KeyPress:
>	ld A, %00111110	   ; Mask: 
>			   ;    Y= WINDOW ZOOM TRACE GRAPH 2ND MODE 
>DEL
>			   ;    UP DOWN LEFT RIGHT
>
>	ld  C, 1	; Get_Key using Port 1 
>	out (C), A	; <Loaded in this fashion updates Flags>
>	in  A, (C)      
>
>	CPL		; Take the complement of A
>	CALL_(DispA)	
>	JUMP_(Loop2)
>;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>DispA:
>	push AF			; Save byte
>	ld (GRAPH_MEM), A
>	ld HL, GRAPH_MEM	; Syntax needed for SHOW_SCREEN 
>routine
>	CALL_(SHOW_SCREEN)	; Sam Davies *Fastest* SHOW_SCREEN 
>Stop:
>	CALL GET_KEY
>	or A
>	jr z, Stop
>	pop AF			; Restore byte
>	RET
>
>;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
>#include "showscrn.h"
>
>.end
>
>;=-=-==-=-=-=-=-==-=-=-=-=-==-=-=-=-=-==-=-=-=-=-==-=-=-=-=-=
>End File: Port1.asm


References: