18
Subroutine name
and address
(in hexadecimal)
CALL GETKY
$0871
CALL ASC
$05F3
CALL HEX
$05FD
CALL 2HEX
$0623
Function
Obtains one character from
the
keyboard and stores it in
the
A register.
For
example, when CALL GETKY
is
exe-
cuted while
the
B
key
is
being pressed, ASCII code $42 (B)
is
set in
the
A register. When CALL GETKY
is
executed
while no key is pressed,
$00
is set
in
the
A register.
The
input
character
is
not
displayed
on
the
screen.
Converts
the
lower 4
bit
contained in
the
A register
into
the
ASCII code corresponding
to
their hexadecimal equiv-
alent and sets it in
the
A register.
For
example, when
the
lower 4 bits
of
the
A register are
1000 ($8 in hexadecimal), $38
(the
ASCII code corre-
sponding
to
"8")
is set in
the
A register.
When the A register contains an
ASCII code corresponding
to
a hexadecimal number, this subroutine sets
the
binary
equivalent
of
the
hexadecimal
number
in
the
lower 4 bits
of
the
A register.
For
example, when
the
A register contains $42,
the
ASCII
code corresponding
to
"B",
lOll
($Bin
hexadecimal)
is
set
to
the
lower 4 bits
of
the
A register.
If
the A register contains codes
other
than
those corre-
sponding
to
characters representing hexadecimals,
the
C
flag (carry flag)
is
set
to
1 and
the
A register contents are
undefined.
C flag
at
return
0: Lower 4 bits
of
A register are
properly set.
1:
Data error.
When
the
2 successive
bytes
of
data contained in the area
starting
at
the
address indicated in
the
DE register are an
ASCII code string representing a 2 digit hexadecimal num-
ber, this subroutine sets the 2 digit hexadecimal number in
the A register and returns control
to
the
calling program.
If
the
ASCII code string does
not
represent any 2 digit hexa-
decimal number, this subroutine sets
the
C flag
to
1 and
returns control
to
the
calling program.
In
this case,
the
contents
of
the
A register are undefined.
Number
of
Stacks
8
2