EasyManua.ls Logo

Atari XL - Page 127

Atari XL
262 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Characters
INTERNAL CHARACTER CODES
117
The
XL
makes
reference
to
the
eight
bytes
defining
a
character
by
assigning
a code,
known
as
the
Internal
Character
Code to
each
one.
This
is
different
from
the
ASCII
code, so to
find
the
eight
bytes
defining
a
character
we
must
first
convert
the
ASCII
code
of
that
character
to
internal
code.
This
is done
with
the
following
formula:
INTERNAL=ASCII+{{ASCII<32)*64)-
({ASCII>31
AND
ASCII<96)*32)
What
this
means
is
that
the
internal
code is
the
same
as
ASCII
for codes
greater
than
95; for codes
less
than
32
the
internal
code is
greater
by
64,
and
for
ASCII
codes
between
31
and
96,
the
internal
code is 32
less
than
ASCII.
Having
worked
out
the
internal
code
of
a
character,
to
find
the
eight
bytes
which
define
it,
we
multiply
the
internal
code by
eight,
and
add
the
start
address
of
the
character
set:
CHARACTER
LOCATION
=(INTERNAL
CODE*8)+{256*PEEK{756»
So
the
defini
tion
of
the
letter
X (ASCII Code = 88;
Internal
Code = 56)
in
the
standard
character
set
is to be
found
at
location:
56*8+{256*{PEEK(756»
=
57792
This
short
program
will
display
the
eight
numbers
defining
any
character.
1
REM
DISPLAY
CHARACTER
DATA
5
OPEN#1,4,0,"K:"
10
PRINT"

Related product manuals