Re: A82: Port 1, the keyboard port.


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

Re: A82: Port 1, the keyboard port.



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.


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


Follow-Ups: References: