The screen memory ASCII code
may
be derived from the main PET
ASCII code by moving
bit
7 of the main code over into
bit
6 and dropping the
previous value of
bit
6. The examples
below
illustrate the
four
cases
of
a 0 or 1 in
bit
7
going
into
a 0 or 1 in
bit
6:
Character
A
Shifted A ( • )
1
Shifted 1 (
E:3
)
Main Memory
Representation
01000001
11000001
00110001
10110001
Screen Memory
Representation
00000001
01000001
00110001
01110001
When
PRINTing to the screen, the PET automatically makes the con-
version to screen codes. Only when vou are PEEKing and POKEing
in
screen
memory do vou need to be concerned about the character set differences.
Screen memory can be considered
to
have
an
additional
"bit"
that
represents the alternate character set by a POKE
59468,14
as described
in
Chapter 5. POKE
59468,12
restores
the
standard set. The alternate set
is
also shown
in
Appendix
A.
ASSEMBLY LANGUAGE PROGRAMMING
PET
BASIC provides
minimal
assistance
to
the user
who
wishes
to
write
and
execute programs
written
in
6502
assembly language.
Assembly
language pro-
grams execute faster and require less
memory
space for a given
function
than
the
equivalent
BASIC program. Vou might
want
to
write
an assembly language
program
to
be run
on
the PET if:
1.
The operation
is
not
fast enough using a BASIC program
2.
The operation
cannot
be
implemented
in
PET
BASIC
3.
The operation takes up
too
much
memory
space
as
BASIC program
4.
Assembly
language lends itself
better
to the task than the BASIC
language. Some
1/0 operations probably fall into this category.
329