Product specifications

GETHCHR: LD A,0
LD HL(KEYCHR) ;Set KEYCHR to zero – no key
LD (HL),A ;pressed
;
LD A,223 ;Select strobe byte to scan
OUT (5+OFFSET),A ;fire key and output to port 5
IN A,(5+OFFSET) ;Examine read lines and if fire
CP 127 ;key is not depressed then goto
JR NZ,GETLEF ;GETLEF else
SET 4,(HL) ;Site fire key bit (condition true)
;
GETLEF: LD A,247 ;Select strobe byte to scan
OUT (5+OFFSET),A ;cursor left key and output to
IN A,(5+OFFSET) ;port 5 – examine read lines and
CP 127 ;if cursor left is not depressed
JR NZ,GETRGT ;then got GETRGT else
SET 0,(HL) ;Set cursor left bit (condition true)
;
GETRGT: LD A,239 ;Select strobe byte to scan
OUT (5+OFFSET),A ;cursor right key and output to
IN A,(5+OFFSET) ;port 5 – examine read lines and
CP 127 ;if cursor right is not depressed
JR NZ,GETUP ;then got GETUP else
SET 1,(HL) ;Set cursor right bit (condition true)
;
GETUP: LD A,251 ;Select strobe byte to scan
OUT (5+OFFSET),A ;cursor up key and output to
IN A,(5+OFFSET) ;port 5 – examine read lines and
CP 127 ;if cursor up is not depressed
JR Z,GETUP ;then got GETDWN else
SET 2,(HL) ;Set cursor up bit (condition true
;
GETDWN: LD A,191 ;Select strobe byte to scan
OUT (5+OFFSET),A ;cursor down key and output to
IN A,(5+OFFSET) ;port 5 – examine read lines and
CP 127 ;if cursor down is not depressed
RET NZ, ; then return to calling routine
SET 3,(HL) ;else set cursor down bit
;(condition true)
;
RET ;Return to calling routine
Get a character ROM routine.
5.4
In m/c code it is easy to get a character by using the call KBD option. The entry point
for DBD is located at £0079. It is designed to be transparent to the user and does not
affect any registers. The only bit affected is the zero flag.