EasyManua.ls Logo

Commodore VIC-20 - Writing Your First Program

Commodore VIC-20
308 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...
WRITING
YOUR
FIRST
PROGRAM
'
I
I
If
you
have used
the
POKE
statement
in
BASIC
to
put
characters
onto
the
screen,
you
will
be
aware
that
the
character
codes
for
POKEing
are
different
to
CBM
ASCII
character
values.
For
example,
if
you
enter:
PRINT
ASC("A")
(and
press
<RETURN>
)
The
VIC
20
will
respond
with:
65
READY.
4
However,
to
put
an
"A"
onto
the
screen by
POKEing,
the
code
is
1.
Since
the
screen
memory
starts
at
7680
(decimal),
or
4096
if
you
have
8K
or
more
of
expansion
memory,
by
entering:
<CLR>
(To
clear
the
screen)
POKE
7680,1
(and<RETURN>
)
(NOTE:
POKE
4096,1
on
a
VIC
20
with
8K
or
more
of
expansion
memory)
â– 
The
"P"
in
the
POKE
statement should
now
be
an
"A."
We
will
now
do
this
in
machine
language.
Type
the
following
in
VICMon:
(Your
cursor
should
be
flashing
alongside a
"."
right
now.)
.A
1400
LDA
#$01
(and
press
<RETURN>
)
The
VIC
will
prompt you
with:
.A
1402
'
Type:
.A
1402
STA
S1E00
(or
STA
S1000
on
a VIC
20
with
8K
or
more
of
expansion
memory)
The
STA
instruction
stores
the
contents
of
the
accumulator
in
a
specified
memory
location.
The
VIC
will
now
prompt
you
with:
.A
1405
"
Now
enter:
.A
1405
BRK
Clear
the
screen,
and
type:
G
1400
132
I

Other manuals for Commodore VIC-20

Related product manuals