Commodore C64 Manual: Commodore 64 Macro Assembler Development System, The (1982)(Commodore) Commodore 64 Macro Assembler Development System, The (1982)(Commodore) User guide

Page 1
THE
COMMODORE
64
MACRO
DEVELOPMENT
t
commodore
ASSEMBLER
SYSTEM
Page 2
THE
COMMODORE
64
MACRO
DEVELOPMENT
Copyright
ASSEMBLER
SYSTEM
1982.
Commodore
Business
Machines
Professional
1200
West
Computer
Wilson
Chester,PA19380
Division
Drive
Page 3
COPYRIGHT
This
software
Commodore
saleofthis
purchaser
onlytoread
computer,
Duplicating,
a
violationofthe
This
manuaiiscopyright
may
not,inwholeorin
translatedorreducedtoany
form
without
Machines
productiscopyrighted
Business
product
only.
Lawful
the
solely
copying,
Machines,
are
intended
usersofthis
program,
for
from
its
the
purposeofexecuting
sellingorotherwise
law.
and
all
rights are
part,becopied,
electronic
prior
consent,inwriting,
(CBM).
Incorporated.
for
medium
DISCLAIMER
COMMODORE
MAKES
NO
RESPECTTOTHE
PERFORMANCE,
PARTICULAR
ENTIRE
THE
RISKASTO
BUYER.
FOLLOWING
CREATOROFTHE
DISTRIBUTORSORTHEIR
COSTOFALL
AND
ANY
EVENT
WILL
INCIDENTALORCONSEQUENTIAL
ANY
DEFECTINTHE
OF
THE
POSSIBILITYOFSUCH
ALLOW
THE
WARRANTIESORLIABILITIES
CONSEQUENTIAL
EXCLUSION
BUSINESS
WARRANTIES,
PROGRAM
MERCHANTABILITY.ORFITNESS
PURPOSE.
SHOULD
ITS
PURCHASE,
PROGRAM.
MACHINES,
EITHER
THIS
ITS
QUALITY
THE
DESCRIBED
PROGRAMISSOLD
AND
PROGRAM
THE
BUYER
COMMODORE,
RETAILERS)
NECESSARY
INCIDENTALORCONSEQUENTIAL
COMMODORE
SERVICING,
BE
PROGRAM
LIABLE
EVENIFIT
DAMAGES.
EXCLUSIONORLIMITATIONOFIMPLIED
FOR
DAMAGES,SOTHE
MAY
NOT
APPLY.
and
all
rights
reserved
The
distribution
the
useofthe
program
into
original
are
hereby
memoryofa
the
program.
distributing
reserved.
photocopied,
mediumormachine
from
Commodore
INC.
("COMMODORE11)
This
reproduced,
EXPRESSORIMPLIED,
HEREIN,
ITS
FOR ANY
"AS
by
licenced
this
product
document
readabie
Business
WITH
QUALITY.
IS".
THE
PERFORMANCEISWITH
PROVE
DEFECTIVE
(AND
NOT
THE
THEIR
ASSUMES
THE
ENTIRE
REPAIRORCORRECTION
DAMAGES.INNO
FOR
DIRECT.
DAMAGES
RESULTING
HAS
SOME
INCIDENTAL
ABOVE
LIMITATION
INDIRECT,
FROM
BEEN
ADVISED
LAWSDONOT
OR
OR
and
is
Page 4
PREFACE
The
Commodore64MACRO
software
Assembly
It
provides
loaders
support
the
much
This
Assemble, You
user's
that
language
This
assembly
experienced
Itisrecommended
manuals
assembly
in
This
Part
assembler
throughout
read
neededtoprograminassembly
Part
composedofSection
conventions
package
language
you
and
routines.
same
levelofdirect
larger
package
load
will
notice
manualisdirected
already
and
productisnot
language,
allows
code,
withavery
two
machine
These
computers.
contains
and
execute
that
like
has
some
the
operationsofthe
intendedtoprovide
but
assembly
that
listed
below
language
parentheses.)
6502
Assembly
(Osborne/McGraw-Hill)
6502
Software
6502
Assembly
(Osborne/McGraw-Hill)
Commodore64Programmer's
(Commodore/HowardW.Sams&Co.)
Programmingin6502,
manual
One,
this
Two,
has
"Introduction"
works
this
section
"'64
Macro
usedbythis
foramore
and
Language
Design,
Language
been
along
manual.Itis
firsttoobtainafeel
Assembler
1-4
ASSEMBLER
youtoprograminthe
directlyonthe
powerful
language
development
machine
everything
the
towards
familiarity
provides
language
the
interfaceasthe
that
6500
series
software
the
with
the
programmer.
user
obtain
detailed
the
Commodore
Subroutines,
Scanlon
Rodnay
divided
provides a
with
and
assembler.
(HowardW.Sams&Co.)
Programming,
Reference
Zaks
into
some
basic
recommended
language
Capabilities
describes
DEVELOPMENT
native
Commodore6dcomputer.
macro
monitors
Assembler,
along
tools
operate
you
will
needtocreate,
Assembly
with
like
Assemblers
language
containedonthis
experienced
the
6500
Commodore64computer.
the
knowledgeof'how
software
computer
series
tools
for
oneormoreofthe
description
64.
(The
publisherislisted
Leventhal
Leventhal
Guide
(Sybex)
five
parts
for
brief
descriptionofhow
terminology
that
for
the
levelofknowledge
and
and
those
and
easier
the
novice user
use
this
Conventions",
capabilities
SYSTEM
6500
series
editor,
other
and
provide
on
code.
diskette,
user
Assembly
to'
the
reference
of
6502
Saville
reference.
an
used
manual.
and
this
in
is
Page 5
Part
Three,
composedofSections
assembly
for
loadingasupport
user
additional
running
loading
usertocreate
Part
Fourofthe
composedofSections
that
allow
Section7describes
Section8describes
object
allows
Finally.
that
canbeused
quick
programs.
"Creating
language
programs.
and
running
and
and
source
programorwedge.
commands
Section6contains
the
edit
manual,
the
usertoassemble,
the
the
program
the
Par!
into
memory;
usertomonitor
Five,
"Appendices",
as a
referencetothe
5-6
Editor64
assembly
"Assembling
7-9
operationofthe
programs
referencetoother
commands
Editing
and
for
and
memory
Assembly
decribes
file.
Section5contains
maintaining
program.
source
contains
test,
that
Section9describes
for
includes
Source
howtocreate
This
the
the
operating
This
files.
and
Testing a
informationonthe
and
debug
assembler
mustbeusedtoload
debugging
those
sections.Italso
available
when
Files",
and
the
instructions
program
disk
program
gives
and
loading
instructions
Program",
object
charts
programs.
program;
the
program
purposes.
and
running
is
edit
an
the
and
for
allows
the
is
programs
an
that
tables
provides
certain
a
Page 6
USER
Throughout
make
given
these.
(
label
opcode
operand
comments
filename
filename*
CONVENTIONS
this
manual
explanations
beiow.Werecommend
)
Parentheses
exceptionstothis rule
indirect
are
required.
Thisisusedtodenotealabel
assembler
determinedbythe
Thisisusedtodenote
as
Thisisusedtodenote
portionoian
Thisisusedtospecify
Thisisusedtospecifyafilenameondisk.
actual
Thisisusedtodenoteawild
filename
the
lower
case
variable
UPPER
NAME
CASE
Generally,
to
Generally,
inputtobe
there
are
certain
less
ambiguous.Alistofthese
that
the
are
usedtodenoteanoption.
indexed
explained.Inthese
and
source
program.
conventions
user
areinthose
indexed
cases
programmer.
oneofthe
specifiedinAppendix
the
instruction.
user
nameisdeterminedbythe
that
begins
with
'■■").
lower
case
variables
youtosupply
the
UPPER
typed.
actual
CASE
NAMES
usedtohelp
conventions
become
familiar
with
The
sections
indirect
the
addressing
parentheses
where
referenceinan
The
actuai
IV.
operand,orargument
label
used
6502
instructions
comments-
The
user.
card
filename
the
characters
specify
data.
are
the
(i.e.,
preceding
thatitis
actual
is
only
are
is
a
up
Page 7
TABLE
64
1.0
OF
MACRO
INSTRUCTION
1.1
1.2
1.3
1.4
1.5
1.6
2.0
ASSEMBLER
3.0
MACRO
4.0
OUTPUT
CONTENTS
ASSEMBLER
FORMAT
Symbolic
Constants
Relative
Implied
Indexed
Indirect
Indirect
Indexed
DIRECTIVES
CAPABILITIES
FILES
GENERATEDBYTHE
CAPABILITIES
CONVENTIONS..
AND
ASSEMBLER
CONVENTIONS
3
5
6
7
7
8
9
10
14
17
CREATING
5.0
5.1
5.2
5.3
6.0
6.1
6.2
6.3
ASSEMBLING
7.0
ASSEMBLINGASOURCE
7.1
7.2
8,0
8.1
8.2
AND
EDITING
ADDITIONAL
Loading
Using
DOS
CREATING
Loading
Using
Editor64
BASIC
the
the
WEDGE64
AND
the Editor64
the
Program
AND
Loading
Using
LOADINGANOBJECT
Loading
Using
the
the
the
the
ASSEMBLY
DISK
DOS
WEDGE64
DOS
WEDGE64
Program
EDITING
Editor64
Program
COMMANDS
ASOURCE
Program
SOURCE
Program
Program
Commands
Commands
TESTINGAPROGRAM
FILE 27
Assembler64
Assembler64
FILE
Loader
Loader
Programs
Program
Program
Programs
FILE
FILES
19
19
19
20
22
23
23
24
27
28
30
30
31
Page 8
9.0
TESTING
AND
DEBUGGING
WITH
THE
PROGRAMS
9.1
Loading
9.2
Using
9.3
MONITOR
APPENDICES
Appendix1OPERATING
AppendixIIINPUT/OUTPUT
Appendix
III
AppendixIV6500
AppendixVA
the
MONITOR
the
MONITOR
Program
DESCRIPTIONOFFILESONTHE
SERIES
SET
OPCODES
SAMPLE
Programs
Programs
Commands
SYSTEM
MEMORY
REGISTER
MICROPROCESSOR
OUTPUT
LISTINGOFTHE
COMMODORE64ASSEMBLER
AppendixVIEXPLANATIONOFERROR
Appendix
Appendix
AppendixIXDOS
VII
ED1TOR64
VIM
MONITOR
COMMAND
COMMAND
WEDGE64
SUMMARY
COMMAND
MONITOR
MAP
MAP
RELEASE
INSTRUCTION
MESSAGES
SUMMARY
32
32
32
33
40
44
DISK....51
53
55
57
64
65
66
Page 9
INTRODUCTION
This
manual
process
series
series
use.
yef
include
The
processoftranslating
computer
program
the
symbolic
machine
association
general,
machine
which
statement.Anassembler
the
one
Useofcross-assemblers
microprocessors
system
However,inthe
floppy disk
development.
Normaly,
representation
ones
and
the
other hand,
system
octal
(base
representations
intoan'accumulator'
10101001
A9
An
instructiontomove
is:
A9
describes
for
Commodore64programs which
microprocessors.
program
all
the
which
development,
are
the
6502
programtoactual
performs
formofthe
formasobject
for
those
one
Assembly
instruction.
may
produce
for
which
has
fewer
caseofthe
and
printer,
digital
zeroes
and
15
computers
of
correspondingtoan 'ON'or"OFF'
finditdifficulttowork
hence,
8).
decimal
of
(binary)
(hexadecimal)
(hexadecimal)
the
Assembly
Several
eachisslightly
sameinprinciple.
through
the
6515
a
mnemonicorsymbolic
machine
the
translationisan
programassource
code.
The
symbols
Language
This
many
are
distinguishes
machine
which
codeisgenerated,iscalledacross-assembler.
for
program
is
common
resources
data
and
useamore
{base
the
6500
are:
because
than
Commodore
the
systemiswell
use
instructions.
10),orhexadecimal
series
the
value
Language
and
use
assemblers
The
(the
codeiscalled
symbols
the
statement
instructions
executesona
development
oftenamicrocomputer
are
needed
the binary
convenient
operationto'load'
of 21
are
available
differentindetail
6500
series
instruction
assembler.Werefer
code
used and
Assembly
will
translate
an
assmbler
fromasingle
computer
foranassembler.
64,
thisisnot
suited
number
Computers
with
the
binary
representation
(base
(decimal)tothe
assembly
oneofthe
sets
formofa
assembly,
and
Language.
fromacompiler
for
for
software
system
understand
state.
information
6500
for
6500
processors
are
identical).
and
the
actual
rules
of
In
into
one
other
than
true.
With
for
Users,
number
such
as
16).
Two
accumulator
of
a
to
a
only
on
Page 10
Users
still
find
numeric
work
with,
and
hence1
example,
In
this
An
form
Each
referredtoas an
the
preceding
LDA
#21
example,
assembler
A9.
machine
can
instructiontobe
LDAisthe
operation
accumulator"isSTA.
x"isTAX.
detailed
Language
specify
A
labelisa 'name'
for
referencebyother
The
one
Additional
reading.
one
be
performedistotally
Carry
The56opcodes
in
Appendix
consistsofan
the
dataonwhich
L2
LDA
labelisL2,
blank
the
must
separate
blanks
Instructions
operand
Bit).
and
many
ProgrammminginAssembly
instruction
data,
the
set
(opcodes),
data
structures
structureofAssembly
thisbyreading
programming
and
manuals
representations
have
developed
instruction
symbol
translate
the
code
The
opcode
for
IV.Amachine
opcode
the
foralineofcode.
instructions,
#12
opcodeisLDA,
the
three
maybeinsertedbythe
for
the
6500
have
none.Inthese
specifiedbythe
Language
addressing
within the
Language
studying
the
suppled
of
instructions
symboJic
representations.
mightbewritten
for
A9,
Load
the
symbolic
form
LDAtothe
executed hasasymbolic
(opcode).
for
the
6500
and
The
opcode
"transfer
series
instruction
perhaps
accumulatortoindex
processors
in
operands,
tedious
as:
Accumulator.
numeric
name
for
"store
are
Assembly
which
operationistobeperformed.
Instructions
as
shown
and
the
parts
(fields)ofthe
programmer
series
processors
cases,
opcodeasin
requires
conventions
processor,aswellasthe
programs.
6500
with
this
The
series
development
maybelabelled
in:
operandis#12. At
instruction.
for
ease
haveatmost
the
operation
CLC
(Clear
learning
for
user
hardware
the
referencing
willbeaided
and
package.
least
of
to
For
to
the
in
Page 11
1.0
INSTRUCTION
Assembler
basic
Machine
Assembler
Machine
on
the
(label)
Fields comments
(Return
contain
A
typical
A
fieldisdefined as a
A
labelisan
instructions
types
accordingtofunction:
instructions,
instructions
6500
series
are
bracketedtoindicate
are
from
onlyalabeloronlyacomment.
instruction
LOOP
firstofwhich opcodes,
These
the:
Accumulator
Stack
Processor
Index
A
label
instruction.
on
data
The
nor
special
pointer
registers(Xand
may
begininany
Labels
elements
operand
a value.Anaddress
the
assembler
formation.
names
subtract,
assemblertocompute
evaluated
An Assembly
and
constants
multiply,
lefttoright
parenthetical
assembly
time
FORMAT
directives
correspondtothe56operations
processors.
opcode
always
Subroutine)donot
LDA
alphanumeric
optional
showing
BETA.X
mustbealpha.Alabel
anyofthe
characters
(A)
(S)
status
portionofan
(P)
are
for
referenceinoperands.
maybecomputedbyexpression
allows
considerable
and
withnooperator
grouping.
and
not
CONVENTIONS
for
the
Commodore64assembler
and
The
instruction
(operand)
:FETCH
stringofcharacters
stringoffrom
(comments)
that
they
and
many
require
all
four
fields
BETA
operands.Aline
may
special
are
Y)
column
used on
Language
single
characters,
usedbythe
provideditis
instructions
instruction
specifies
flexibility
expression
separatedbyoperators,
divide).
operand
Note
execution
Expressions
addresses.
precedence
that
expressions
time.
format
are optional.
opcodes
is:
INDEXEDBYX
separatedbya
onetosix
suchasRTS
notbeanyofthe
i.e.
assemblertoreference
the
first
as
branch
eitheranaddress
in
expression
consistsofa
+.-,',
are
evaluated by
Expressions
and no
are
evaluated
areoftwo
implemented
is;
Labels
characters,
and
may
also
space.
the
56
A, S,P,XorY.
fieldofan
targets
evaluation
and
or
and
string of
and/(add,
the
are
at
Page 12
Any
siringofcharacters
comment
blank
processedasa
comments
separate
AppendixVpresentsasample
Various
andislisted,
characterofany
comment.Oninstructions
may
follow
the
fields ofaninstruction.
examplesofinstruction
following
but
not
further
recordisa
the
opcode.Atleast
output
the
operand
processed.Ifthe
semi-colon
(;),
which
one
listing
format
from
are included.
fieldisconsidered
first
the record
is
a
non-
requirenooperand,
space
must
the
assembler.
Page 13
1.1
Symbolic
Perhaps
symbolic
In
contains
label
instruction:
the
valueatthe
Memory
into
differentlybythe
memory
operation
those
two.
If
BETAislocatedatbyte4Bin
generatedisA5
at013Cinmemory
isanexampleof"absolute"
and
page
codeinpage
the
operand
the
most
common
formasin:
LDA
this
BETA
example,
the
BETAisa
valueiobe
;PUT
foranaddressatwhich
LDA
address
pagesof256
ALPHA+BETA
ALPHA+BETAiscomputedbythe
computer
associated
addressisloaded
with
bytes
assembler
storage
codesifthe
cases,
For
example:
LDA
space.
the
addressisonly
BETA
B4.
Thisiscalled
operand
page
execution
zero
time,aprogrammer
memory
whenever
zero,asproblems
asembler
makes
address
computation.
decisionsonwhich
operand
BETA
label
loaded
the
the
6500
each.
The
and
Manyofthe
one.
the
addressing.
possible.
addressing
modeisthe
VALUEINACCUMULATOR
referencingabyteinmemory
into
the
accumulator.
valueislocated,
BETAisa
Similarly,inthe
assembler,
into
the
accumulator.
series
first
processor
addressisin
one
page
page
code
mayheencountered.)
processorsissegmented
page,
page
zero,istreated
for
optimization
instructions
byte
rather
zero
zero
have
alternate
page
zero
than
the
memory,
then
addressing,IfBETA
generatedisAD3C01.
Thus,tooptimize
should
design
(Please
avoid
with
assembling
Remember,
formtouset
based
memory.
normaE
the
storage
data
that
and
the
of
In
code
is
This
areas
on
in
Page 14
1.2
Constants
Constant
valuesinAssembler
constantisother
type:
$
(Dollar
@
(Commercial
%
(Percent)
(Apostrophe)
sign)
immediate
The
absenceofa
statement:
LDA
the
decimal
Similarly;
LDA
denotes
for
the
The
immediate
followedbya
LDA
specifies
Similarly;
LDA
will
load
Since
rangeof0lo255
Immediate
machine
used), the
constant
in
immediate
locations
BETA+5
number5is
BETA
that
the
hexadecimal
address
computation.
modeofaddressing
constant.
#2
that
the
»'G
the
ASCII
the
accumulatorisone
decimal.
mode
addressing
code
(dependingonwhether
opcode,
values
canbeusedinaddress
mode
as explainedina
Language
than
decimal,aprefix
specifies
at)
specifies binary
specifiesanASCII
hexadecimal
specifies
instructions.
prefix
symbol
indicates
addedtoBETAtocomputer
+ S5F
valueof5FistobeaddedtoBETA
For
example;
decimal
valueofthe
value2istobe
characterGinto
byte,
generates
and
the
valuetobe
addressing.
They
later
sectionasassembler
can
lake
several
forms.Ifa
characterisusedtospecify
octal
literal
character
decial
is
signified
value.Inthe
by
put
into
a #
the
the
the
value
loaded
twoorthree
or not
zero
mustbein
bytes
page
usedasoperand.
expressions
can
aisobeusedtoinitialize
in
the
address-
(pound
sign)
accumulator.
accumulator.
of
addressing
Note
that
andasvalues
directives.
the
is
Page 15
1.3
Relative
There
are
eight
conditional
In
this
example:
BEQ
if
the
labelled
or
negative execution. pointingtothe
offsetisbasedonthe
address
from assembly addressing.
other
1.4
Implied
Twenty-five
X)
requirenooperand,
the
operand
Four
accumulator, these
onlyanoperation
START
values
compared
STARTismade.
offset
At the
;IF
whichisaddedtothe
time
next
instruction
mustbewithin
the
conditional
timeifa
Relative
than
branch.
branch
branch
addressingisnot
instructions
addresses
instructions.
four
instructions
ASL,
A,
canbeusedasan
codeisgenerated.
branch
EQUAL
are
equal,atransfertothe
The
instructions
BRANCHTOSTART
branch
addressisa
program
the
additionismade,
beyond
locationofthe
127
bytes
instruction.
target
falls
suchasTAX
and
hence,
are
impliedbythe
LSR,
ROL
are
treatedasimplied
the
next
forwardor128
An
outside
used
(Transfer
are
single byte
and
RORT
operand.Inthis
availabletothe
instruction
one
byte
positive
counter
the
program
branch
instruction.
instruction.
bytes
error
willbeflagged
the
bounds
for
any
during
counter
A
branch
backward
for
instructions
Accumulator
instructions.
operation
are
code.
specialinthat
special
mode
addressing
case,
user.
is
The
at
relative
to
Index
Thus,
the
and
Page 16
1,5
Indexed
In
this
register
below,
which
LDA
the
parentheses
above
sum
must
execution,
forcingapage
in
page
byte,
high
following:
BETA
X
Locations
Location
Then
BETA
valueat$0125is$37.
the
value
used
for
formofaddressingisshowninthe
Indirect
mode,
BETA).
contains
example,
contains
the
operand
(the
index)tothe
The
resulting
the
actual
(BETATX)
around
the
valueinindex
referencealocationinpage
the
high
order
zero
address.
zero
memory
byte
format.
contains
$4
$0017
$0125
+ Xis$16.
$37
into
the
addressiscomputedbyfirst
argumentinthe
valueisthe
operand
the
operand
byteofthe
The
are
taken as
For
purposesofillustration,
$12
and
$0016
contains
the
and
accumulator.
contain
$37
addressatlocation
hence
the
registerXis
two
the
accessingatableofaddress
operand
indirect
address.Inthis
indicates
(tn
the
page
zero
example:
indirect
mode.Inthe
addedtoBETA.
zero
memory.
addressisignored:
bytes
startingatthat location
addressofthe
During
operandinlow
assume
$01
and
S25
516isS0125.
instruction
(This
addressing
vectorsinpage
following
LDA
(8ETA.X)
modeisoften
zero.)
illustration.
adding
the
example
address
That
thus,
the
the
loads
This
X
BETA
$16
S17
S0125
LDA
(BETA,X
^-
/
\
)
12
LOW
25
HUGH
01
VALUE
+4—
S12+$14=$16
BYTE
^*
BYTE
37
Page 17
1.6
Indirect
Another
illustrated
LDA
In
this
addressistobefound.
addresstocompute
example
GAMMA
Y
Locations
Location
The
addressatS38is$0054;
effective
into
the
In
indexed
indirection.
indexYis
always
absolute
causesabranchtothe
DELTA+1.
following
Indexed
mode
of indirect
by:
(GAMMA),Y
case.
GAMMA
the
that.
contains
contains S7
SQ039
and
S005B
address
accumulator.
indirect,
In
addedtocompute
indexed
indirect
The
illustration.
contains
S005B.
the
indirect
except
address,asexemplifiedbyJMP
indirect
referencesapage
The
actual
$38
The
indexXis
indexed,
foraJMP
address
indexed
addressing
uses
zero
index
locationatwhich
valueinindexYis
addressofthe
$0038
contain
$00
and
$126
sevenisthen
addedtothis,
valueatS005Bis$126
addedtothe
the
indirectionisdone
the
effective
instruction
address.
which
containedinlocations
modeofaddressingisshowninthe
registerYand
addedtothat
operand.
S54
Suppose
giving
whichisloaded
operand
(DELTA)
priortothe
and
then
Indirect
allows
mode
a
which
DELTA
is
an
for
an
the
is
and
LDA
GAMMA
S38
$39
S005B
(GAMMA).Y
-*
VALUE
38
54
00
50054+$7=S5B
126
Page 18
2.0
ASSEMBLER
There
are
eleven
direct
informationtothe
a
periodasthe
an equals
asterisk.
correspondstothe
sometimes
are
given
sign(=)to
(')
"RED-5.
below
.BYTE
.OPT
DIRECTIVES
assembler
first
means
read
as "here"or"this
BLUE=SFF.
(their
useisexplainedinthis
.WORD
END
directives
assembler.
character.
establishavalue
Ihe
valueofthe
ORG
The
directiveinsome
and*=
.DBYTE
.FILE
.PAGE
.LIB
usedtoreserve
Nine
have
symbolic
tenth,asymbolic
forasymbol-
current
location".
location
assemblers.Itis
Some
equate,
The
counter.
equate
$200".Alistofthe
section):
.SKIP
storage
directives
and
names
eleventh,
with
uses
This
examples
is
Labels
period.
Examplesofassembler
Assembler
If
abbreviatedtothe
.BYTEisusedtoreserve
value.
valuesinconsecutive
enclosing
SHIFT
ASCII
Note
In
to
a
example:
couldbeusedtostore:
It
directiveisnot
and
symbols
programinAppendix
desired,
all
directives
The
directive
the
7.)Itshouldbenoted,
characters
HERE
THERE
ASCII
that
numbers
general,
eight
quoteinan
shouldbenoted
any
bits,
BYTE
JIM'S
CYCLE
maybeusedinthis directive.
ASCII
'JIM"S
other
period
may
string
with
that
.BYTE
.BYTE1,$F,
.BYTE
mayberepresentedinthe
valid
6500
string,
CYCLE1
that
supportedinthis
than
directives
which
and
one
contain
bytes.
quotes.
canbestoredineach
2
series
insert
the
useofarithmetic
directives
can
V.
are
precededbythe period
three
byteofmemory
multiple
ASCII
strings
(All
however,
may
not
be seeninthe
characters,
e.g.,
and
operands
maybegenerated
quotes
that
thereisa
are
.BYTE
@3,
%101,
'ABCDEFH'
expression
two
quotesinthe
versionofthe
7
most
which
Ifitis
operationsinthe
package.
begin
with
a
sample
may
be
'.BYT.
loaditwith
which
"single"
limitationof40
a
will
store
by
quotes,
i.e,
directive.
convenient
form.
canberesolved
desiredtoinclude
string.
For
.BYTE
10
Page 19
.WORDisusedtoreserve
valid
expression,
operand
field.
except
For
example;
HERE
THERE
WHERE
The
most
common
showninthe
16
bit
addressesot-HERE11
series are
byte.
The
fetched
Therefore.
hexadecimal
Q3tFF.ifthis
.DBTYEisexactly
byte,
low-byte
.DBYTE
will
generate
usedasindirect
Equal(=)is
locations,
symbol.
HERE
WHERE
4=$200
NB=8
MB=NB+
$FF03
the
reset
use
previous
from
.WORD
portionofthe
orderisnot
like
order.
FF,03.
addresses.
EQUATE
the
5
Q
101
the '="directiveisvery
of
purposes.
Asterisk
createanobject
greater
"-S2001. starts
Expressions
flagged
(')
directiveisusedtochange
code
than
zero,
assemblingataddress
must
as an
error.
-=C+D-E+F
the
not
wouidbelegalifC.D.E
anyofthe
that
variables
expressions
are
and
for
ASCII
.WORD
2
.WORD1,SFF03.
.WORD
HERE,
for
WORDisto
example
and
memoryinthe
generates
desired,
.WORD,
For
example:
Thus,
fields
directive
program
*
counterO,or
1
+
2
*
+
powerful
program
'•'
directive
contain forward
For
example:
andFare
were
defined
evaluated
load
two
bytesofdataata time
strings,
maybeusedinthe
@3
THERE
generate
labelled
"WHERE",
"THERE'.
order
the
valueinthis
example
use
except
(SFF03)
.DBYTE
the
bytes
addresses
Addressesinthe
low-byte,
wouldbestored
rather
are storedinhigh-
generatedby.DBYTE
andisusedtoreserve
assignavaluetoa
reserve
reserve
set
assign
assign
that
one
byte
two
bytes
program
and
canbeused
starts
counter
value
value
the
program
assemblyatany
mustbeused.
For
$200.
references
all
defined,
lateronin
in strict
lefttoright
or they
but
the
program.
Any
as
which
stores
the
6500
then
htgh-
order.
than
,WORD.
may
not
be
memory
forawide
counter.
variety
To
address
example.
will
be
wouldbeillegal
Note
if
also
order.
11
Page 20
.PAGEisusedtocauseanimmediate output
printedatthe topofthe
Ifatitle is
is
.SKIPisusedtogenerate
not
is left
.OPTisthe
generationofoutput
in
NOERRORS;
Also
Default
listing
PAGE
PAGE
PAGE
redefinedorcleared.Atitle
.PAGE
and
may
alsobeusedtogenerate
defined,
it-willbeprintedatthe
'
'
output
listing.
'THISISA
'NEW
maybecleared
blank
appear,
treated
sideofthe
.SKIP 2
.SKIP
BYTE
.OPT
.OPT
valid
.OPT
but
its
position
as a
valid
listing
SKIP
most
powerful
directives.
LIST,
NOLIST;
is:
OPT
settings
are:
maybefoundina
input
"list"
will
jumpbytwo
3*2-1
directive
fields,
The
ERRORS,
NOE,
LIST.
LIST,
listings
options
GENERATE,
NOL,
ERR
ERR,
and
skip
skip
LIST.
jumptotopofpage on
TITLE'
linesina
the
list
when
two
blank
five
lines
skip
one
line
andisusedtocontrol
and expansionofASCII
available
NOGENERATE.
GENERATE
NOG
NOGEN
or reset
TITLE'
topofeach
with:
listing.
are:
The
listing.
number
the
printedonthe
next
lines
ERRORS,
directive
The
lineisprinted.
the
the
title
page
until
it
will
directive
the
strings
12
Page 21
Here
are
descriptions
ERRORS
NOERRORS:
Usedtocontrol
contains
the
source
tor
eachofthe options:
creationota separate
lineinerror
facilityisnormallyofgreatest
limited
examined
thenbeexamined.
until
.OPT
all
print
capacity.
until
errors
all
errors
Another
ERROR,
have
The
have
been
corrected,
error
NOLIST
with:
,OPT
NOLIST:
LIST
Usedtocontrol
source
instruction
GENERATE
input,
countifenabled.
NOGENERATE:
Usedtocontrol
The
first
two
characters
willbeprinted
NOERRORS.
the
generationofthe
errors/warnings,
printingofASCII
characters
will
(normally
GENERATEisused.
.END
shouldbethe
physical
for
.LIB
assembly.
temporarily
starts
original
endofthe
program
allows
documentation.
the
When
ceases
reading
source
encounteredinthe
can
contain
on
and
.FIL
canbeusedtolink
assembly.Alibrary
.LJB.
butitmay
file
containingitand
the
OPERAND.
which
when
created.Anassembler
.END
directive.
other
off.
etc.
maybelinkedby.FIL
using
this
last
directiveina
file.
Its
useisoptional,
usertoinsert
the
asembler
reading
irom
the
file
resumes
library
assembler
file
containa.FIL,Al_FIL'
source
file
namedinthe
when
file.
directives
another
calledbya .LIB
transfers
There
arenorestrictionsonthe
directives.
directivetoensure
pass
can
error
file.
The
and
the
error
message.
usetotime
file
maybeturnedonand
been
corrected.
possibilityisto
and
sharing
This
run
with:
then
make
users
listing
one
LIST
listing
code
generation,
Stringsinthe
alwaysbeprinted,
two
file
source
code
encounters
code
from
end-of-file
The
control
to turn
filetoa
source
current
may
terminates
readingtothe
file
which
symbol
.BYTE
and
subsequent
bytes
per
line),
andisusedtosignal
but
highly
from
this
directive,
the current
.LIB.
Processingofthe
recommended
another
(EOF)or.END
file
containing
the
listing
one
during
not
contain
assemblyofthe
file
numberoffiles
Caution
thatnocircular
onlybeterminatedby(EOF)
should be
linkages
error
tiie
This
who
have
file
may
more
run
contains
table
and
directive.
if
the
file
into
the
it
fi!e
and
is
the
.LIB
function
another
named
on
exercised
are
or
13
Page 22
3.0
MACRO
Macros
{label)
CAPABILITIES
take
the
general
.MAC
macro
form
name
TEXTOFMACRO
(label),MND
The
directive
createsupto
explicitly
except
directive
on
.MAC
respectively
immediately
To
callamacro,
parametersasindicatedinthe
macroname
The
macro
parameterasindicated
Within
the
temporary
designates
encountered,
assemblyatthat
are
substituted
parameter
generateaname
durationofthat
To
giveabrief
precision
.MAC
INC
BNE
INC
?2
.MND
When
following
This
LO01
the
DPINC
generates
.MAC
definesamacro
nine
parameters
declare
that
.MND
and
the
textofthe
parameters.
they
cannot
identifies
.MND
label
succeeding
the
name
mustbedelimited
symbol
contain
the
are
optionalasdenotedbythe
the
first
generated
the
user
simply
parami,
above.
macro
ll?1T
followedbya
Macros
endofa
last
param2,
definition,
parameter3.During
the
text
includedinthat
point
and
the
for
the
temporary
name
when
the
macroiscalled,
for
that
parameter
call.
example,
(16-bit)
quantity.
supposewewishtoincrementadouble
Then,
DPINC
?1
?2
?1+1
macroiscalledtoincrement
call
lineisused.
COUNT
the following
INC
BNE
INC
code:
COUNT
L001
COUNT+1
showninthe
with
the
for
that
macro.
may
contain
the
directives
macro
statement
generated
gives
the
marco
cali
line
below:
by a
space
a
parameterisdesignated
digit1through9.Thus,
assembly,ifa
macroisinserted
parameter
namesatthe
names.Ifthe
(if
oneisneeded)
the
macro
;DOUBLE
PRECISION
the
following
given
The
code:
macro
user
does
arbitrary
.MAC
and
.MND.
definition.
The
parenthesis.
and
the
statement
statement.
name
and
before
macro
the
call
into
calling
user
failstosupply
the
assembler
for
the
definitiontodo
INCREMENT
variable
COUNT,
name
not
text,
labels
lists
first
is
the
point
will
this
the
and
The
They
the
by
l?3'
a
is:
14
Page 23
In
this
example,
automatically
distinct
programmer
of
to
Macro
exceed
labels
leaving
the
second
can
eight
the
during
following the
suppliesasecond
that
parameter
parameter
call
other
levels.
internal
macro
label
expansion.
progression
parameter?nthe
blank,
the
insteadofL001.
macros,
but
name
''LOOl11.isgenerated
Subsequent
L002. L003.
internal
the
depthofthe
calling
label
name
calls
produce
etc,Ifthe
line,
willbeset
nesting
cannot
instead
Empty
Empty
The
parameters
the
Concatenated
A
blanks,sothataparameter
names
XX?
XXAA
XXA2
Notice
Parameters
parametersincall
FUNCTN
FUNCTN
AA,.,DO
,.CC,.EE
callsonFUNCTN
being
programmer.
Names
macro
parameterissuppliedtoa
and
allocate
.MAC
1
AA/OR
*=*
+
.MND
DECL
WOR
'="
+
5
DECL
.WOR
*=*
+
that
there arenoblanksinthe labels
given
space
?2
10
lines
given
here
generated
canbeusedtocreate
for
the
DECL
0
AA.5
0
A2,10
are
denotedbycommas:
PARAMETERS?2AND?3ARE
EMPTYASARE:?5THROUGH
:?1,
?2.
AND?4ARE
?6;
THROUGH
will
resultindifferent
names,ornames
macro
without
EMPTYASARE
^9
internal
supplied
leadingortrailing
new
variable
variables.
DECLARED
THISISA
STORAGE
MACRO
CALL
:THISISHOWITEXPANDS
fTHISISA
[THISISHOW
SECOND
THE
CALL
SECOND
EXPANDS
XXAA
and
XXA2.
?9
local
from
CALL
15
Page 24
ExpressionsAsParameters
Parametersofmacros
include
expressions
must
Assembler
Note:
Commodore
new
This
command.
view
embedded
are
make
sensetothe
MAC
CMP
BCS
-MND
LSS
LSS
LSS
The
LSS
?1
?2
XX+5.EXIT
#SF3,EXIT
(XX.UEXIT
Output
macro
assemblerindeciding
ruleisthe
An
identifier
otherwiseitis
following:
ruleisidenticaltothe
Hence,
the
final
printed
canbearbitrary
commas,
inserted
Format
assembler
that
assumedtobeanopcode.
semicolons,orblanks.
into
the
assembler.
uses
beginsincolumn1is
rule
the
FORMAT
formatofedited
expressions
macro
;IF
;COMPARE
;COMPARE
ILLEGAL—AN
different
definition,
ACCUM
LESS
WITH LOCATIONXX+
WITH
rules
the
THAN?1GOTO
LITERAL
EMBEDDED
than
howtoformataprint
printedasa
usedbythe
command
editor
now
files.
for
permits
thatdonot
When
the
expression
COMMA
the
previous
line.
The
label,
the
FORMAT
the
user
?2
5
to
16
Page 25
4.0
OUTPUT
There
are
optional
directive.
the
symbol
includedinthe
code
for
The
cross
assembler.
a
report
numbersinwhich
FILES
three
output
and
can be
The
listing
table.
The
listing
the
loader.
reference
This
fileisusedbythe
showing
all
GENERATEDBYTHE
files
generatedbythe
created
file
file
variables,
each
through
contains
error
file
file}.
The
may
optionallybegeneratedbythe
their
variableisused.
the
the
contains
interface
cross
declared
ASSEMBLER
assembler.
useofthe
program
list
all
error
file
contains
reference
addresses,
Each
file
.OPT
assembler
with
errors
and
lines
and
errors
the
object
programtoprint
and
ail
line
is
(as
Listing
The
on
sections:
This
selected.Itcontains
with
erroneous
Appendix
assemblyispresentedatthe
The
is
their
File
listing
the
Program
listing
the
file
willbeproduced
.OPT
assembler
Program
and
will
and
Error
alwaysbeproduced
assembled
statements,
directive.
Error
List
the
source
code.
Errors
(An
explanationoferror
VI.)Acountofthe
Symbol
Table
symbol
take
will
alwaysbeproduced
used.Itcontainsalistofall
addresses.
unless
This
List,
the
NOLIST
fileismadeupof
and
Symbol
unless
Table.
the
statementofthe
and warnings appear
errors
and
endofthe
warnings
parogranv
unless
symbols
usedinthe
optionisused
two
NOLIST
program
option
is
along
after
codesispresented
found
during
the
NOSYM
program,
in
the
option
and
17
Page 26
Interface
This
loaded
the
follows:
Where
1.
All
each
2.
The
3.
n1nO
4.
a3a2a1aO
5.
(d1dO)
6.
x3x2x1xO
The
1.;00
2.
c3c2dcO
3.
x3x2xlxO
File
file
does
and
convertedtomachine
first
and
;
n1nO
the
following
characters
representing
semicolonisa
format
not
contain
true
object
codebythe
all
succeeding
a3a2a1aO
statements
(n,a,d,x)
a
The
numberofbytesofdatainthis
hexadecimal).
(d1dO)
The The
8-bit
a3a2a1aO:
Two
of
representsasingle
hexadecimal a3 represents
representedby(d1dO)1isstoredinaddress
hexadecimal
data.
low-order
(decimal)
Record
all
charactersinthe
a3a2a1aO,
check
sum,
characters)istreatedas8
sumofthese
sumofcharacters.Togenerate
each
records,
(d1dO)1
are the
hexadecimal
record
(d1dO)2...(d1dO)23
apply:
ASCII
mark
Each
starting
address
(d1dO}2isstoredin(a3a2a1aO)+1,etc.
digits
(d1=high-order4binary
4-bis).
A maximumof18
bytesofdata
check
sum.
but
excluding
byteofdata
8-bit
bytesistruncatedto16
bits(4hexadecimal
in
the
recordasfour
for
the
last
recordina
;00c3c2dcO
Zero
bytesofdata
identify
This
hexadecimal)inthis
record.
Check
thisasthe
represents
sum
x3x2x1x0
areinthis
final
the
for
this
code,
but
data
except
for
which
loader.
the
last
can
The
format
record,isas
x3x2x1xO
characters
digit.
indicating
pairofhexadecimal
byte.
address
bits15thru
representingan8-bit
zero
the
startofa
record
for
bits
(Hex)or24
through
record.
(in
characters
the
record.
12,
etc.
byte
anddO-
per recordispermitted.
Thisisthe
record,
the
(represented
digits)
ASCII
hexadecmial
including the
record
binary
andisthen
characters
mark
and
the
by
two
bits.
The
represented
(x3x2x1xO).
sum
n1nO and
the
check
ASCII
binary
binary
file isasfollows:
record.
recordina
total
numberofrecords
file.
NOT
including
record.
The
zeros
file.
the
(in
last
be
for
F,
The
of
Page 27
5.0
ADDITIONAL
WEDGE)
On
the
release
disk
housekeeping
the
directory,
loading
program
5.1
When
the
checks
passing
linking
To
and
wedge
RETURN
loaded,acopyright
5.2
The
(and
provides
Loading
this
programisloaded
operating
all
keyboard
the
into
load
the
LOAD
press
"DOS
RETURN.
program
before
Using
the
wedge
program
includedinBASIC
to
read
the
directory
to
load
and
with
the
capabilityofcreating
(volumne
and
(and
Each
Section
(commercialatsign)
creation
the
capabilitytoperform
file
whose
command
5.3.
interchangeably
ortoread
drive,
begin
the
andtoterminate
the
commandtoload
automatically
the
commandtoloadaprogramatBASIC'S
The%(percent
programatits
begin
the
command
BASIC
diskisa
initializing
running)
are
the
DOS
system
entry
onto
the
CHRGET
wedge
DISK
COMMANDS
program which
functions
programs
short
(copying,
the
disk
and
WEDGE64
and
and
BASIC
entries
program,
for
the
BASIC
routineinpage
enter:
WEDGE64".8,1
This
will
loadaprogram
into
memory.
removing
notice
DOS WEDGE64
supports
(copy,
(without
run
programs.
allows
Once
the
diskette.
willbedisplayed.
Program
allofthe
scratch,
overwriting
The
wedge
and
youtogroup
operations
name
begins
begins
The
character
and>(greater
to
begin
directory.
runs a
program.
with
withasingle
used
anyofthe
They
are
the
DOS
(at
BASIC'S
The/(backslash)isusedtobegin
sign)isusedtobegin
load
address.
for
Finally,
savingafiletodisk.
drive,
from
simple
Program
executed,it"wedges"
interpreter.
its
command
interpreter.
loaded,
rename,
maintaining
certain
characterasspecified
dependsonthe
than
disk
also
Wedge.
the*■(back
(DOS
SUPPORT
will
aid
youinperforming
scratching,
checking
disk.
The
and
are
zero).
type
When
same
renaming,
the
disk
status,
commands
very
Thus,
the
characters
(Thisisdone
that
"boots"
RUN
the
wedge
commands
that
usetul.
itself
wedge
before
by
the actual
and
press
program
that
reading
and
this
into
is
are
newadisk),acommand
memory),
program
certain
using a
and
commands
also
provides
volumesoffiles
programs
wild
card
you
together)
filename
charactersj.
in
command.
sign)
are
used
housekeeping
usedtoresetorinitialize
Thet(up
arrow)isused
StartofText
StanofText
the
commandtoload
arrow)isused
The
@
commands
the
address)
and
address.
a
to
to
19
Page 28
5.3
DOS
WEDGE64
A
descriptionofeach
AppendixIXprovidesabrief
commands.
■a
Typing
disk
code:
this
character
status.
10
20
30
This
OPEN
INPUT#15,A.B$,C.D
PRINT
Program
commandisgiveninthe
Commands
summaryofthe
alone
will
provide
performs
15,8.15
A:BS;C;D
the
same
following
DOS
WEDGE64
the
user
with
functionasthe
the
following
./r${drive}:(filename)n([volume]|
This
command
and
printilto
present,
begin
willbedisplayed.If'isspecified,
with the
volumnisspecified
volume},
printed.
@
N(drive):diskname,id
This
command
m
R(drive):newfile([volume])
This
command
specifiedbynewfile.
^C(drive):newfile([volume])
This
command
specifiedbynewfile.If[volume]isspecified,
createdonthat
■n
S(drive):1ilenarnen<[volume])
This
command
specified,
willbescratched.If[volume]isspecified,
containedonthat
^Ul
This
command
•;1
(drive)
This
command
@Q
This
command
will
the
letters
then
only
will
will
will
volume.
scratches
all
files
(drive}
will
will
will
read
the
directory
screen.Iffilenameisspecified,
specifiedbyfilename
(where
those
volumeisthe
files
containedonthat
formatadisk
rename
copy
beginning
volume
reset
initialize
terminate
the
the
file
the
file
with
willbescratched.
the
DOS.
the
the
from
the
disk
drive
only
that
all
files
whose
willbeprinted.
characteridof
volume
using
the
name
andidspecified.
=
oldfile([volume])
file
specifiedbyoldfiletothe
=
oldfile([volume])
specifiedbyoldfiletothe
the
newfile
specifiedbyfilename.If*
the
letters
disk
drive.
wedge
specifiedbyfilename
only
those
files
program.
pages.
current
BASIC
specified
file,
if
names
If
that
will
be
name
name
will
be
is
that
are
20
Page 29
/filename
This
command
/ASM.C64
will
cause
memory.
command:
LOAD
Please
programs,ormachine
note
Thisisbecause
and
will
instead
%filename
This
command
load
address.Itdoes
LOAD
where
This
filenameisthe
t
filename
command
specifiedbyfilename
LOAD
followsbythe
Again,
run
from
This
please note
BASIC
BASIC.
filename
command
will
load
the
the
program
This
command
named
does
"ASM.C64",8
that this
command
code
the
computer
loadatthe current
will
load
the
the
*lfilename".8,1
nameofthe
allows
the
and
"filename",8
BASIC
command
that
this
programs,ormachine
saves
the
file
specifiedbyfilename.
"ASM.C64"tobe
the
same
can
onlybeusedtoload
programs
will
ignore
"StartofBASIC
file
specified
same
thingasthe
programtoload,
usertoload
does
the
same
RUN.
command
code
program
specified
For
loaded
thingasthe
into
BASIC
BASIC
that
are
booted
the
file's
from
own
load
Text"
by filenameatits
and
BASIC
run
command:
the
program
tilingasentering:
can
onlybeusedtoload
programs
that
are
booted
by filenametodisk.
example:
BASIC.
address
area.
own
and
Page 30
6.0
CREATING
The
editorisusedtoenter
assembler.
editor
and
DELETE
GET,
withinarange,
PUT,
detailedinthe
The
editor
already
that
commands.
The
CBM
return.
methodinwhich
existinginthe
you
trytocreate
data
ASCII
The
filenames.
byte
$00.
SEQ.
Each
file's
AND
The
editor
allows
AUTOmatic
BREAK,
summaryatthe
commands
filesonwhich
characters
only
restrictionondata
the
The
files
When
listingadirectory,
formatissequential, withaterminating
EDITINGASOURCE
and
modify source
retains
KILL,
allofthe
Sine
and
reNUMBER.
and
FORMAT.
numbering,
endofthis
operateina
computers
short
example
the
assembler
with
each
assembler
are
sequential
similar
BASIC.
files
line
files
parses,
and
these
FILE
files
for
the
featuresofthe
FIND,
Other
commands
Allofthe
BASIC
CHANGE,
include
commands
section.
fashiontothe
For
practice,wesuggest
using
the
operates
are
terminatedbya
is in
naming.
spaces
are
mustbeterminated
files
will
showasfile
commands
editor
madeupof
carriage
Duetothe
not
allowed
by a
zero byte
screen
are
in
zero
type
($00),
22
Page 31
6.1
Loading
The
editor
LOAD
or
%0;EDITOR64
To
initiate
command,
the64editor
to
clear
assembler
6.2
Using
When
typed
such
10
will
notbetokenized
you cannot
this
problem,
the
computertoreturntoBasic.
Source
loaded,
at
1000.
.FILEora
with
the
the
Editon34
mustbeloaded
"EDITOR64'\8.1
(if
the
the
editor,
the
editor
has
the
text
source
the
Editor64
the
Editor64
as:
FOR1=1TO
type
will
been
pointers.
files.
Programisin
(converted
typeaBASIC
disable
files
are
the
editor
After
editing
.END
'PUT'
command.
the
loaded
generates
the
assembler
Program
with
wedgeisenabled)
•SYS49152".
respond
loaded.Atthis
You
are
Program
10
line
with
editor
with
the
the
file,
insure
directive.
Important:Besuretosave your
command
RefertoAppendix
BEFORE
loading
V!l
the
foranEditor64
the
Basic
LOAD
After
withamessage
potnt,
now
readytoeditorenter
operation,
into
BASIC
the
editor
with
the
'KILL'
"GET"
command.Asthe
line
numbers
that
the
Then,
completed
assembleroryour
Command
command:
typing
typeaNEW
any
BASIC
keyword
turned
commandorreset
automatically
last,
lineinthe
save
the
file
using
Summary.
the
SYS
indicating
that
command
statement
tokens).
Thus,
on.Toavoid
file
is
starting
fileisa
fileonthe disk
the
PUT
file
willbelast.
23
Page 32
6.3
Editor64
AUTO
The
AUTO
new
source
following:
AUTO
wheren1is
To
disable
increment.
CHANGE
The
CHANGE
string
in
the
CHANGE/stM/str2/
Program
Line
Numbering
command
code
file.Toenable
n1
the
optional
the
AUTO
string
command
with
another
following
format:
\
siri
str2
tn1-n2
Delimits
either
Search
Replacement
Range
LIST
is
CPUT
Command
The
CPUT command
spacestothe
is
the
sameasthe
DELETE
The
DELETE
time.
Simply
(The
formatisthe
DELETE
To
deleteasingle
and
press
disk
function
input
the
sameasthe
n1-n2
line,
RETURN.
Commands
generates
increment
function,
automatically
(multiple
,n1-n2
string)
parameters.
new
line
numbers
the
AUTO
between
type
the
AUTO
locates
occurrences).
the
str1
and
str2
string
string
The
formatisthe
while
command]
line
numbers
command
and
This
commandisentered
(use
any
commandinBASIC.Ifomitted,
searched.
outputs
for
later
PUT
command.
allows
rangeoflinestobe
enter
(Optional)
source
assembly.
the
the
files
The
usertodelete
LIST
commandinBASIC).
line
number
withnounnecessary
syntax
deleted
for
several
aloneona blank
entering
type
the
printed.
without
replaces
character
one
sameasthe
the
whole
this
command
linesata
(n1
through
a
an
not
in
file
n2).
line
24
Page 33
FIND
String
The
FIND
commandisusedtosearch
character
the
can
RUN/STOP
FORMATted
The
format
must
Note:
press
printing.
GET
This
editor
memory.
Note:
numbersby10.Ifn1isgreater
file
stringsintext.
CRT.
You
can
pause
thenbecontinued
key.
The
FIND/str1/
,(n1
/
stn
,n1-n2
Delimiter
Search
Range
BASIC
Print
FORMAT
like
type
FORMAT
ThJs
space
Files
commandisusedtoprint
the
assembler.
mnemonicsincolumn
(n1-n2)
n1-n2
Range
(Optional).
command
bar
to halt
Press
the
Each
the
printing
with
the
formatofthe
n2)
(useacharacter
string
parameter.
(Optional)
For
parametersofthe
has
the
printing
RUN/STOP
commandisusedtoload
from
disk.Itcan
GET
-filename"
n1
n2
n3
GET
starts
being
loadedisappendedtothe
alsobeusedtoappendtofiles
,(ni)((n2)H(n3}
Begins
currentlyinmemory
Device
Secondary
numbering
inputting
number,
address
linesat1000
occurrenceofthe
space
this
same
and
keytoterminate
assembler
than
lor
and
locate
specific
stringisprinted
with
the
space
bar.
barForterminated
FIND
command
Sameasthe
the
functiontowork
two,orone
same
controlsasFIND.
another
source
is;
notinthe
text
space
string)
LIST
command
fileintabbed
correctly,
from
(ormatasLIST,
For
space
bartorestart
the
program.
text
files
already
sourceatthis lineinthe
(Optional)
defaultis8
defaultis8
any
endofthe
(Optional)
(Optional)
and
incrementing
line
numberinmemory,
current
file.
on
Printing
with
the
in
you
labels.
example,
into
the
in
file
the
line
the
25
Page 34
KILL
Command
This
type
LIST
The
editor
command
the
same
Command
causes
command
LIST
command
commandjnBASIC,
LIST(n1}-(n2)
where
'n1-'
list
ReNUMBER
The
the
PUT
The
assembly.
resident
If
ni-n2
specifiesarangeoflines.
(which
all
NUMBER
fileinmemory.
NUMBER
Command
PUT
will
lines
from
Lines
function
(n1).(n2),{n3)
n1
n2
n3 Step
command
PUT
list
the
Old
New
has
file.
PUT
"filename"
n1
n2
n3
n4
n1-n2,n3,n4
Starting
Ending
Device
Secondary
are
left
all
outputs
the
.(n1-n2),{n3Mn4)
the
editortodisengage.Torestart
usedtostart
worksinthe
lines
from
beginningupto
alllows
start
start
size
the
line
number
line
for
resequence
source
abilitytooutput
line
number
line
number
number,
address,
out,
the
whole
the
editor
same
mannerasthe
Valid
parameters
n1 to
the
end)
and
and
including
usertorenumber
(Optional)
number
{Optional)
(Optional)
filestothe
disk
allorpartofthe
(Optional)
(Optional)
defaultis8
(Optional)
defaultis8
fileisoutputtothe
the
editor,
(SYS49152).
LIST
also
include
"-n2'
(which
n2).
will
allorpart of
for
later
memory
(Optional)
disk.
26
Page 35
7.0
ASSEMBLINGASOURCE
Onceasource
disk
(by
using
loading
load
programs
7.1
To
the
the
assembler
Loading
load
the
LOAD
Wedgeisloaded)
After
loadingiscomplete,
assembler
when
execution
fileisreadytoassemble,
the
PUT
assembler
which
do.
the
Assembler64
assembler,
"ASSEMBLER64",8
will
printacopyright
begins.
FILE
command).
program.
will
Pleasebesuretodo
Once
resideinthe
Program
type:
(or
/ASSEMBLER64ifthe
type
RUN
notice
you
must
first
saveiton
this
thisiscompleted,
same
area
and
press
RETURN.
and
the
first
that
user
you
The
prompt
before
will
BASIC
DOS
27
Page 36
7.2
Using
the
Assembler64
Whenaprogramisbeing creating
contains
the assembly
names
and
It
shouldbenoted
overwrite filename the
cross
wanttocreate
Although
and
options
time).Ifyou
file
When
If
and
Next
if simply
cause
Next,
If
RETURN.Ifnot,
Finally,
Enter
After
execute.Ifduring
assembly
two
typesoffiles.
the
data
necessarytocreateamachine
loader).
areinthe
The
starts.
for
these
format
nameofthis
The
files
anyofthese
each
time
old
object
reference
cross
option,
the
OBJECT
you
want
press
you
HARD
you
wantahardcopy
press
the
you
CROSS
you
want
SOURCE
the
entering
file
before
files,
new
you
willbegiven
reference
canbechosen
want
both
and
once
assembler
FILE
the
assemblertocreateanobject
RETURN.Ifnot,
willbeprompted
COPY
(CR/YORN)?
RETURN.Ifnot,
outputtobe
willbeprompted
REFERENCE
a cross
simply
you
willbeprompted
FILE
nameofthe
this
process
however,
(CRORD:NAME):
assembly,
will
assembled,
remaining
are
automatically
ilXXLLOOO0"
files.Ifyou
you
assembleaprogram,
you
the
same
cross
reference
files
before
(becauseofthe
files,
with
the
starts,
printout,
listedtothe
reference
press
NAME?
source
last
prompt,
stop.
Program
the
user
has
The
first
typeisan
object
fileisspecifiedbythe
files
are
cross
reference
generatedbythe
and "XXFF0000".
that
the
assembler
wishtouse
the
you
run
the
assembler.
procedure
the
optionofcreating
assembly
run the
cross
the
first
press
RETURN.
with:
enter
enter
with:
(CR/NOORY)?
file
created,
RETURN.
with:
file
that
the
the
symbol
should
files.
starts,
numberoffiles
assembly
reference
prompt
Y and
N and
screen.
you
assembler
once
option.
will
file
press
press
enter
wishtoassemble.
program
table
overflows,
the
option
file
code
user
program
of
which
(by
before
files.
The
assembler
program
must
In
be followed
will
same
object
-scratch"
the
case
of
not
if
bothanobject
only
oneofthese
openatone
with
the
object
be:
enter
the
filename
RETURN
RETURN.
Y and
or
This
press
begins
will
to
the
you
file
28
Page 37
HALTING
When
pressing willbestopped
continue
to
terminate
key
users without
assembly.
THE
ASSEMBLER
the
assemblerisrunning,
the
RUN/STOP
and
the
assemblyorto
the
assembly
will
continue
printers,asthe
key.ffthisisdone,
the
program
the
assembly
operation
will
terminateitcompletely.
and
returntoBASIC.
process.
screen
maybehalted
the
assembly
wait
for
the
Pressing
This
featureisuseful
listing
canbeexamined
usertoeither
Press
by
process
theBkey
any
other
for
during
CROSS
If
was
this
program.Toload
Once
cross
Press
and
REFERENCE
you
chosetocreateacross
mentioned
cross
LOAD
this
reference
HARD
above.Tolookator
reference,
"CROSSREF
programisloaded,
listing
COPY
RETURNifyou
press
RETURN.
FILES
reference,
you
must
first
this
program,
64",8
program
(CR/YORN)?
type:
type
will
wantahardcopy
two
files
willbecreated
produceahardcopy
load
the
cross
reference
RUN
and
press
RETURN
prompt
with:
printout;
otherwise,
as
printout
of
listing
and
the
enter
N
29
Page 38
8.0
LOADINGANOBJECT
The
Commodore64Assembler
format
LOADEDsothe
Loader.
8.1
There
disk.
This
loader.Toload
where
shows
that
can
notbedirectly
program
Loading
Each
allows
LOAD"filename",8r1
Name
LO-LOAD.C64
HI-LOAD.C64
the
Loader
are
two
versionsofthe loader
versionispositionedina
the
usertoload
oneofthe
filenameisthe
the
names,
canbeexecuted.
Program
programtobe
load
points
Load Address
$0800
SC800
FILE
produces
executed-
includedonthe
different
anywhereinRAM
Loader
programs,
loaded.
and
run
commands
Run
RUN
SYS
portable
This
outputinan
output
Thisisthe
development
areaofRAM
by using
type:
The
following
for
Command
51200
ASCII
must
be
functionofa
memory.
the
correct
table
each
loader.
30
Page 39
8.2
Using
Both
and
copyright
usedtoplace
thatitwas
area
can
The
program
than
examples
After
object
search
program
feedback
message
There
documenting):
Errors
is
closed,
the
Loader
the
HI-LOAD
operateinthe
notice
where
thenbeprogrammed
offsetisa
and prompt
object
assembled
thereisno
two
addresses.Ifthe
SFFFF,
Program
S0400
S3000
$0400
$9000
SE000
the
the
address
show
how
Address
offsetisentered,
filenametobe
for
the
file,
will
print
only.
When
bENDOFLOAD1
are
three
errors
BAD
RECORD
NON-RAM
CHECKSUM
are
LOAD
considered
and
controlisreturnedtoBASIC.
Programs
and
LO-LOAD
same
manner.
code
into.
RAM
byte
hexadecimal
offset
loaded.
and
start
the
input
the
that
COUNT
ERROR
fatal;
loaders
When
the
user
intoanaddress
This
allows
and
load
into
EPROM
program
wraps
Offset
soooo
soooo
$2000
S9000
$4000
around
works.
the
loader
The
loader
the
load.Asthe
datatothe
loadiscompleted,
and
returnstoBASIC.
can
occur
are
about
activated,
fora
load
offset.
range
the
usertoassemble
intoaRAM
etc..
address
address
through
Addre
AddressofObject
S0400
$3000
52400
$2000
$2000
will
CRT.
thatisaddedtothe
plus
$0000.
prompt
will
then
dataisloaded,
Thisisfor
the
duringaload
the loadisterminated,
512
bytes
long
the
loaders
The
other
than
area.
The
the
offsetisgreater
The
print
offset
the
for
object
following
Code
the
user
for
the
initialize
loader
the
the
user
prints
the
{eachisself
the
object
a
is
one
an
drive,
file
31
Page 40
9.0
TESTING
The
MONITORisthe
64.
This
youtocreate,
subroutines.
examine
9.1
Loading
There
are
Assembler
The
only
resides.
MONITORSC000
MONITOR
the
intended
To
load
LOAD
SYS
LOAD
SYS
9.2
Using
The
MONITOR
registers,
prompt
command. Appendix
To
exit
the
AND
programming
modify
The
MONITOR'S
and
change
the
MONITOR
two
machine
Development
differenceisthe
MONITORS8000
residesatmemory
programs
location
and
activate
"MONITOR$8000",8,1
32768
■■MONITOR$C000",8,1
49152
the
MONITOR
programs
typingaperiod,
that
lets
you
The
commands
VIII
providesasummaryofMONITOR
MONITOR
DEBUGGING
machine
aid
contains
and
test
memory
language
disk:
areaofmemoryinwhich
residesatmemory
WITH
language
many
machine
purposeisto
while
debugging
Programs
monitorsonthe
MONITOR$8000
location
are
both includedincase
lor
the
machine
the
appropriate
monitor,
(monitorat$8000)
or
(monitoratSC000)
Programs
will
respondbydisplaying
and
flashing
know
the
MONITOR
are
describedonthe
program,
reset
THE
MONITOR
monitor
features
language
for
the
that
programs and
makeiteasy
your program.
Commodore
and
MONITOR$C000.
the
location
SC000.
code
programtoreside.
$8000
The
one
interferes
enter:
the
the
cursor.
The
programiswaiting
following
commands.
the
machine.
PROGRAMS
Commodore
will
enable
for
you
to
64
program
and
two
with
CPU
periodisa
for
your
pages.
Page 41
9.3
MONITOR
COMMAND:
Purpose:
Syntax:
A(address)(opcode
(address):Afour-digit
memorytoplace
{opcode
mnemonic,
(operand):
addressing
required
addresses,afour
equaltoSFFFFisrequired.)
A
RETURNisusedtoindicate
are
any
errorsonthe
an
error,
canbeusedtocorrect
Afteralineofcodeissuccessfully
printaprompt
instruction,
than
once
Commodore
prompt.
Example:
COMMAND:C(COMPARE)
Purpose:
Syntax:
(Start
of
(End
of
C(start
Address):Afour
the
areaofmemorytocompare
Address):Afour
the
areaofmemorytocompare
Program
A
Enteralineofassembly
the
mnemonic):Astandard
i.e.
LDA,
The
operand,
modes.
whose
valueisless
Commands
mnemonic)(operand)
hexadecimal
opcode.
STX,
ROR,
when
(For
zero-page
thanorequalto$FF.
digit
hex
number
code.
number
MOS
etc.
as definedinAppendix
required,
modes,atwo
whose
the
endofthe
line,aquestion
andaperiodistypedonthe
any
errorsonthe
assembled,
containing
so
'A'
and
when
typing
64.Toexit
.A1200
.A
Compare
LDX
1202
two
address)(end
the
next
legal
the
line
numberdonot
assembly
this
#$00
language
mode,
press
areasofmemory
address)(with
digit
hex
number
against.
digit
hex
number
against.
assembly
canbeof
markisdisplayedtoindicate
next
memory
indicating
indicating
indicating
language
anyofthe
digit
For
valueisless
assembly
line.
The
screen
original
line.
the
assembler
location
havetobe
programs
RETURN
address)
after
the
the
the
location
IV.
legal
hex
number
non-zero
than
page
or
line.Ifthere
editor
will
for
an
typed
more
into
the
the
'A'
start
address
end
address
in
is
(With
Address):Afour
addresssofthe
The
address
a
spaceorcomma.Ifthe
64MON
memoryisthe
two
descending
will
areas
other
fields
shouldbeseparated
printaperiod,
sameasthe
which
are
order.
different,
digit
hex
number
areaofmemorytocompare
two
areasofmemory
indicating
first.
The
are
indicating
by a
valid
are
that
the
second
addresses,ofany
printed
outonthe
with.
delimiter,
33
the
start
the
same,
area
bytesinthe
screen
such
then
of
in
as
Page 42
COMMAND:D(DISASSEMBLE)
Purpose:
mnemonics
Syntax;
(address
be
disassembled.
(address
the
The
spaceorcomma.
different
the
(for
A
disassembly
any
RETURN.
Disassemble
and
D(address
1):Afour-digit
machine
operands.
1}(address
hexadecimal
2):Anoptional
codetobe
address
first
characterofa
disassembled.
fields
shouldbeseparated
The
than
the
input
formatofthe
formatofan
disassemblyisa
readability).
listing
changestothe
This
will
canbemodified
mnemonicoroperandonthe
enter
code
2)
four-digit
the
hexadecimal
line
and
modifications.
A
disassembly
control.
a
cursor
another
backwards
screen
Example:D1000 1400
COMMAND:F(FILL)
Whenalineofdisassemblyisat
disassembled
and
Purpose:
Syntax:
Fladdress
(address
(address
(byte):Atwo
consecutive
This
commandisuseful
RAM
area.
Example:F0400
Fills
memory
instruction,)
canbescrolledupor
down
will
cause
throughadisassembly
hitting
.,
.,
.,
1000
1002
1003
cursor
LDA
???
BNE
Fillarangeoflocations
1)(address
1):
The
first
2):
The
last
digit
hexadecimal
memory
0518
locations
the
screentoscrollupone
lineofcode.
up).
#$00
Sf1030
withaspecified
2)(byte)
locationtofill
locationtofill
numbertobe
locations
for
initializing
EA
from
$0400to$0518
into
assembly
starting
addressofthe
language
ending address
by a
delimiter
disassemblyisonly
assembly.
comma,
using
call
downonthe
This
also
(i.e.T
goingtothe topofthe
The
rather
the
screen
screen,
the
assembler
screen
the
bottomofthe
works
differenceisthat
linetodisplay
for
byte.
with
the
value
specifiedby(byte)
with
the
value
specifiedby(byte)
written
data
structuresorany
with
into
SEA(aNOP
code
of
suchasa
slightly
thanan'A'
editor.
for
scrolling
Make
then
press
further
via
cursor
screen,
other
to
34
Page 43
COMMAND:G(GO)
Purpose:
Syntax:
(address):Anoptional
program
address
currentPCcanbeviewed
TheGOcommand
command)
Cautionisrecommendedinusing
sometimesbewisetosetabreakpoint
program
system.)
Example:G040C
Execution
COMMAND:H(HUNT)
Purpose:
occurrencesofa
Syntax;
(address
(address
(data):
ASCII
An
quote,
Multiple
Example:HC000
Begin
executionofa
programata
G(address}
counter
is left
out,
and
begin
argument
and
address
execution
will
restore
executionatthe specified
specifying
where
wili
using
executionisto
beginatthe
theRcommand.)
all
registers
theGOcommand.
executiontoprevent
beginsatlocation
Hunt
through
H(address
1):
Beginning
2):
Ending
Data
settobe
string)
memory
set
of bytes.
1)(address
addressofhunt
addressofhunt
searched
ASCIIisspecifiedbypreceding
i.e.,
'STRING.
two-digit
Data
hex
arguments
FFFF
H
A000
A101A9FF
lossofcontrolofthe
040C.
withinaspecified
2)(data)
procedure
(data
maybehexadecimaloran
the
maybesingleormultiple
mustbeseparated
'READ;Search
4C;
Search
in
tnat
sequence
somewhereinthe
procedure
first
specified
the
new
current
(displayabie
address.
valueofthe
start.
When
PC.
(The
by
the
starting
address.
(It
may
line
operating
range
for
all
character
for
ASCII
for
data $A9,
withasingle
arguments.
by a
space
string
READ
$FF,
the
R
of
$4C.
35
Page 44
COMMAND:I(INTERROGATE)
Purpose:
specified
Syntax:
(address
(address
The
character
The
This
Whenalineofthe
down
lineofthe
goingtothe topOfthe
Note:
period
Example:1C000 C020
DispiaysinREVERSE
COMMAND:L(LOAD)
Purpose:
Syntax:L"filename".(device)
filename:
(device):Atwo-digit
to
load
The
starting
PGM
into
machine
relocatable.
marker
Example:L"SCREEN".01:readsafile
Display
address
1(address1)(address
1):
2):
ASCII
characters
with
display
allows
will
cause
listing.
Whenacharacterisnot
(.).
Loadafile
Any
01iscassette
08isdisk
LOAD
command
addressiscontainedinthe
file),inother
the
same
language
(EOF)isfound.
memoryinASCII
range.
Starting
Ending
canbemadetoscrollbyusing
continuing
addressofASCII
addressofASCII
are
displayedinreverse
the
hexadecimal
the
search
listingisat
the
screentoscrollupone
This
also
screen
all
data
from
cassetteordisk.
legal
Commodore6^filename
byte
indicating
(or
09.
etc.)
causesafiletobe
words,
pJaceitwas
work,
The
file
L
'TANK".O8
the
saved
since
willbeloaded
:readsafile
character
2)
dump
dump
data
displayedonthe
beyond
the
bottomofthe
works
for
and
typing
printable,itwillbedisplayed
from
SCOOOtoSC020,
the
the
scrolling
cursor
device
loaded
first
two
LOAD
command
from.
few
programs
into
Thisisvery
memory
from
from
format
the
linetodisplay
bytesofthe
within
video
(to
contrast
screen),
cursor
search
backwards
number
into
always
up/down
parameters.
screen,acursor
(i.e.,
up).
from
memory.
file
loadsafile
important
are
completely
until
the
endoffite
cassette
disk
drive
the
the
key.
another
as a
which
The
(in
a
in
36
Page 45
COMMAND:M(MEMORY
Purpose:Todisplay
specified
Syntax;
(address
(address
bytes
Memoryisdisplayedinthe
Memory
move
correction
an
attempttomodify
displayed.
As
with
screen
controls.
Example:M0000
address
M(address
1):
First
2):
Last
willbedisplayed.)
.:AO48
7F E7 00AAAAAE02
content
the
cursortothe
and
the
DISASSEMBLY
maybescrolled
memory
range-
i)(address
addressofhex
addressofhex
maybeedited
datatobe
press
RETURN.Ifthereisa bad
ROM
bothupand
.:00004C7FEFAA0002F7FF
The
first
eight
bytesofmemory
DISPLAY)
as a
hexadecimal
2)
dump
dump
following
using
has
occurred,anerror
and
INTERROGATE
are
(Optional.Ifomitted,
format:
FF
the
modified.
down
displayed.
dump
screen
editor.Toedit,
Type
the
RAM
commands,
by using
within
desired
locationorif
flag
(?)
will
the
cursor
the
eight
be
the
37
Page 46
COMMAND:N(NEW
Purpose:Torelocate
offsettothe
Syntax:
(address
(address
(offset):
Code
moved
a
value
from
SAOOOto$0400
£A000+$6400=310400,
computer,
{ref
1):
equalto{ref1)and
value,
by
(ref
i.e.,
'operand+(offset)'.
2):
withavalue
W;
Relocate
theWis
Oftenitis
memorytoanother
code.
Thenbyusing
runinthe
operandsofthe
N{address
1):
Starting
2):
Ending
Valuetobe
fromahigh
which
Any
Upper
wraps
the
resultis$0400.
three
the
operandofthe
timitofoperandstorelocate
greater
word
included.
useful to
new
COMMAND:R(REGISTER
Purpose:
register,
registers
Syntax:
Note
bit.
is
appropriatetopoint
instructionisexecuted,
ORe'd
(the
makesnodifference.
causes
Example:
Show
program
and
R
that
the
Since
the
into
break
flag!)
problems
the
stack
eighth
the
R
LOCATOR)
absolute
i)(address
addressofcodetobe
addressofcodetobe modified
addedtooperandofinstructions
locationtoa
around.
will
requireanoffsetof$6400.
but
byte
instruction
less
than
thanorequalto(ret
tables,
address
(optional).
Relocation
moveasectionofcode
(see the
the
"N"
space.
DISPLAY}
important
counter,
stack
status
always
which
6502
the
pointer
pointerisdisplayed
bitofthe
outabuginthe
the
byte
andisstoredonthe
set.
However,
are very
PC
.;
057F
memory
target
2)(offset)(ref
For
since
(ref2}willbeoffsetbythe
three
then
"I11
command)tomake
command,
registers.
accumulator,
are
stack
stack
For
99.9%ofatl
when
difficulttotrack
SR
01
referencesbyadding
code.
1)<ref
2)W
modified
low
locationinmemory
example,apieceofcode
thereisnotabit
whose
operandisgreater
byte
instruction
(see
2) will
Every
two
becomes
the
data
from
code
The
theXandYindex
displayed.
without
pointer
eighth
this
has
6502.
bitofthe
applications,
bug
nineinthe
willbereplaced
ref
1).
notberelocated.
bytes
willbeoffset
independent.
one
room
can be
program
its
implied
been
WhenaPHP
stack
stack
does
turn
down.
AC
XR YR SP
02 03 04
FE
an
needs
moved
than
or
(offset)
Any
operand
if
area
in
for
more
changed
to
status
eighth
mentioned,
pointer
with
bit
this
up.
it
is
four
it
Page 47
COMMAND:S(SAVE)
Purpose;
Syntax:
filename:
be
(device):
cassette,
disk
(address
(address
dataupto,
saved.
The
bytes
mayberecalled
Example:3'GAME11.08,0400,OCOO
saves
COMMAND:T(TRANSFER)
Purpose;
another.
Syntax:
{address
(address
(address
placed)
Data
Additional
backward
Example:T1400 1600
shifts
memory.
Save
the
contentsofmemory
SMli1ename",(device),{address1).(address2)
Any
legal
filename
enclosedindouble
Two
possible
use
device
driveisusually
1):
Starting
2):
Ending
but
file
createdbythis
contain
memory
the
Transfer
T(address
1):
Starling
2):
Ending
3}:
Starting
can be
moved
memory
any
01.
08.
addressofmemorytobe
addressofmemorytobe
not
including
starting
using
from
S0400toSOCOO
segmentsofmemory
1)(address
addressofdatatobe
addressofdatatobe
addressofnew
from
segmentsofany
numberofbytes,
for
saving
quotes;
devices
The
single
are
device
the
commandisa
address
the
'L'
command.
2)(address
low
memorytohigh
i.e..
onto
the
quotes
cassette
numberofthe
byteofdataatthis
load
(address1)of
onto
disk.
from
3)
moved
moved
location
length
shifted.
1401
data
from
$1400upto
and
including
tapeordisk,
data.
The
are
illegal.
and
disk.Tosave
Commodore
saved
saved,
file,
plus
i,e..
the
the
one
memory
(where
filename
address,
data.
the
must
on
one.
All
whl
first
two
The
area
data
will
64
be
file
to
be
memoryorvice-versa.
canbemoved
$1600,
one
forward
byte
higher
or
in
39
Page 48
APPENDIXIOPERATING
Hex.
Label
D6510
R6510
ADRAY1
ADRAY2
CHARAC
ENDCHR
TRMPOS
VERCK
COUNT
DIMFLG
VALTYP
INTFLG
GARBFL
SUBFLG
INPFLG
TANSGN
LINNUM
TEMPPT
LASTPT
TEMPST
INDEX
RESHC
TXTTAB
VARTAB
ARYTAB
STREND
Addr.
0000
0001
0002
0003-0004
0005-0006
0007
0008
0009
OOOA
000
B
OOOC
000D
000E
000F
0010
0011
0012
0013
0014-0015
0016
0017-0013
0019-0021
0022-0025
0026-002A
002B-002C
OO2DO02E
002F-0030
0031-0032
Dec.
Loc.
0
1
2
3-4
5-6
7
&
g
10
11
12
13
14
15
16
17
ta
19
20-21
22
23-24
25-33
34-37
38-42
43-44
45-46
47-48
49-5C
SYSTEM
MEMORY
Description
6510
On-Chip
Register
6510
On-Chip
Output
Do
Not
Jump
Vector:
-
Integer
Jump
Vector:
-Floating
Search
Flag:
String
Screen
TAB
Character
Scan
Column
Fiag:0=Load1=
Input
Buffer
of
Subscripts
Flag:
Default
Data
Type;
$00=
Numeric
Data
Type:$80=Integer
$00=
Floating
Flag:
Data
quote/Garbage
Flag:
Subscript
Function
Flag:
$00=
S98=READ
Flag;
TAN
Result
Flag:
INPUT
Temp:
Pointer:
Integer
Stack
Last
Temp
Stack
for
Utility
Pointer
Floating-Point
Multiply
Pointer:
Pointer:
Variables
Pointer
Pointer
MAP
Data-Direction
8-Bit
Input/
Register
Use
Convert
Convert
1or
QuoteatEnd
Pointer/Number
Array
$ff=String
scan/LlST
Collect
Ref/User
Call
INPUT
sign/Comparison
Prompt
Value
Temporary
String
Temporary
Area
Product
StartofBASIC
StartofBASIC
StartofBASIC
EndofBASIC
Floating
Integer
From
Last
Verify
Dimension
$40=
GET
String
Address
Strings
of
Text
Arrays
Arrays
of
40
Page 49
Label
FRETOP
FRESPC
MEMSIZ
CURLIN
OLDUN
OLDTXT
DATLIN
DATPTR
INPPTR
VARNAM
VARPNT
FORPNT
FACEXP
FACHO FACSGN
3GNFLG
BITS
ARGEXP
ARGHO
ARGSGN
ARISGN
FACOV
RODBS
RODBE
IRQTMP
ENABL
Hex.
Addr.
0033-0034
00350036
0037-0038
0039-003A
003B-003C
003D-003E
003F-0040
0041-0042
00430044
0045-0046
0047-0048
0049-004A
004B-0060
0061
0062-0065 0066
0067
0068
0069
006A-006D
006
E
006F
0070
029
D
029
E
029F-02A0
02
A1
02A2-02FF
02A6
02A7-02FF
Dec.
Loc.
51-52
53-54
55-56
57-58
59-60
61-62
6364
65-66
67
68
69-70
71-72
73-74
75-96
97
98-101
102
103
104
105
106-109
110
111
112
669
670
671-672
673
674-677
678
679-767
Description
Pointer;
Storage
Utility
Pointer:
BottomofString
String
Pointer
Highest
Address
UsedbyBASIC
Current
Previous
Pointer:
CO
Current
Pointer:
NT
BASIC
BASIC
DATA
Current
Line
BASIC
Line
Line
Statement
DATA
Number
Address
Vector:
Current
Pointer:
Variable
Pointer:
FOR/NEXT
Temp
Floating-point
#1:
Floating
Floating
Pointer:
Constant
Floating
Digit
Floating-Point
#2:
Floating
Floating
Sign
Accum.#1vs
Floating
Order
RS-232
(Page)
RS-232
Buffer
Holds
I/O
RS-232
Interrupts
Cassette
Flag:
INPUT
BASIC
Current
Routine
Variable
BASIC
Data
Index
Variable
Pointer/Data
Area
Accumulator
Exponent
Accura
Accum.
Series
Accum.
#1:
#1:
Evaluation
#1:
Accumulator
Exponent
Accum.
Accum,
Comparison
#2:
#2:
Result:
#2
Accum.
(Rounding)
StartofOutput
IndextoEndofOutput
IRQ
Current
Temp
0= NTSC
#1.
Vector
During
Enabled
Data
Video1=
Video
Not
Used
Number
Number
for
Item
Name
for
Mantissa
Sign
Overflow
Mantissa
Sign
Low-
Buffer
Tape
Area
PAL
41
Page 50
Label
I
ERROR
IMAIN
ICRNCH
IQPLOP
IGONE
IEVAL
SAREG
SXREG
SYREG
SPREG
USRPOK
USRADD
CINV
CBINV
NMINV
IOPEN
ICLOSE
ICHKIN
ICKOUT
ICLRCH
I
BASIN
IBSOUT
I
STOP
IGETIN
tCLALL
USRCMD
ILOAD
ISAVE
TBUFFR
Hex,
Addr.
0300-0301
0302-0303
0304-0305
0306-0307
0308-0309
030A-030B
030C
030
D
030
E
030
F
0310-0313
0314-0315
0314-0315
0316-0317
0318-0319
031A-031B
031C-031D
031E-031F
0320-0321
0322-0323
0324-0325
0326-0327
0328-0329
032A-032B
032C-032D
032E-032F
0330-0331
0332-0333
033C-03FB
Dec,
768-769
770-771
772-773
774-775
776-777
778-779
780
781
782
7S3
784787
785-786
788-789
790-791
792-793
794-795
796-797
798-799
800-801
802-803
804-805
806-807
808-809
810-811
812-813
814-815
816-817
818-819
828-1019
Loc.
Description
Vector:
Message
Vector:
Vector:
Vector:
Vector:
Vector;
Evaluation
Storage
Storage
Storage
Storage
USR
USR
Vector:
Interrupt
Vector:
Vector:
Interrupt
OpenaLogical
CloseaSpecified
Kernal
Open
Close
Print
BASIC
BASIC
Tokenize
BASIC
BASIC
BASIC
for
for
for
for
Function
Function
Hardware
SRK
Warm
BASIC
Text
Char
Token
6502.ARegister
6502.XRegister
6502.YRegister
6502
.SP
Jump
Jump
IRQ
Instr.
Interrupt
Non-Maskable
File
Logical
CHK1N
Channel
Input
Routine
for
Output
and
Output
Error
LIST
Dispatch
Channels
Kernal
Kernal
Vector
Scan
Get
Queue
CloseaSpecified
User-Defined
Load
Save
Tape
CHRIN
CHROUT
Stop
Character
(Keyboard
RAM
RAMtoa
I/O
Routine
Routine
Key
from
Vector
fromaDevice
Device
Buffer
Keyboard
Buffer)
Logical
Start
Text
Register
Instr
($4c}
Address
File
Vector
Vector
File
42
Page 51
Label
ViCSCN
Hex.
Addr.
0400-07FF
0400-07E7
07F8-07FF
0800-9FFF
S000-9FFF
Dec.
AO0O-BFFF
COOO-CFFF
DOOO-DFFF
EOOO-FFFF
Loc.
1024-2047
1024-2023
2040-2047
2048-40959
32768-40959
40960-49151
49152-53247
53248-57343
Description
1024
Area
Video
Columns
Sprite
Normal
Optional
Bytes
BASIC
8K
RAM-4096
Input/Output
Color
Generator
Bytes
57344-65535
Kernal
8K
Byte
Screen
Memory
Matrix:25Linesx40
Data
Pointers
SAStC
ROM-8192
RAM)
RAMorCharacter
Program
Cartridge
Bytes
ROM-8192
Bytes
Devices
ROMorRAM-4096
ROM-8192
RAM)
Bytes
Space
(or
and
(or
43
Page 52
APPENDIXIIINPUT/OUTPUT
Hex.
0000
Decimal
0
Bits
Description
0-7
MOS
6510
REGISTER
Data
MAP
Direction
Register
0001
d000-
dO2e
dooo
dooi
d002
d003
d004
d005
d006
d007
d008
d009
dOOa
dOOb
dOOc
dOOd
dOOe
dOOf
d010
dO11
dO12
dO13
d0i4
dO15
dO16
1
0
5324B-54271
53248
53249
53250
53251
53252
53253
53254
53255
53256
53257
53258
53259
53260
53261
53262
53263
53264
53265
6
2-0
53266
53267
53268
53269
53270
7-6
5
Bita1:0utput
MOS
/LORAM
i
/HIRAM
/CHAREN
2
Cassette
3
4
Cassette
Cassette
5
6-7
Undefined
Sprite0X
Sprite0Y Pos
Sprite1X Pos
Sprite1Y
Sprite 2XPos
Sprite2Y Pos
Sprite
Sprite3Y
Sprite4X
Sprite4Y
Sprite5X Pos
Sprite 5
Sprite6X
Sprite6Y Pos
Sprite 7XPos
Sprite 7
Sprites
VIC
Raster
7
Extended
Bit-Map
5
Blank
A
Select
3
Smooth
Read
IRQ
Light-Pen
Light-Pen
Sprite
VIC
Unused
Reset
6510
MOS
Bit=0:
Micro-Processor
Signal(0=
Signal(0=
Signal
Data
Output
Switch
Motor
6567
Control1=
Video
Inputx=
Switch
Switch
(0=
Switch
Line
Sense1=
Interface
On-Chip
BASIC
Kernal
Switch
OFF0=
Pos
Pos
3 X
POS
Pos
Pos
Pos
Y Pos
Pos
Y Pos
0-7XPos
Control
Compare:
Color
(msbofX
Register
(Bit8)See
Text
Mode:l=Enable
coord.)
53266
ModeH=Enable
ScreentoBorder
24/25
Row
ScrolltoY
Raster/Write
Color:0=Blank
Text
Display:1=25Rows
Dot-Position
Raster
Value
LatchXPos
LatchYPos
Display Enable:1=Enable
Control
VIC
Register
Chip:1=
Reset0=Normal
Don't
Care
I/O
Port
ROM
Out)
ROM
Out}
Char.
ROM
In)
Closed
ON
Controller
(0-7)
for
(VIC)
Compare
44
Page 53
Hex.
Decimal
d0i7
d0i8
3019
dOia
dO1b
53271
53272
53273
53274
53275
53276
dOic
53277
dO1d
dO1e
53278
53279
dOif
53280
d020
d02i
53281
dO22
53282
dO23
53283
53284
dO24
dO25
53285
53286
dO26
dO27
53287
53288
6028
53289
dO29
d02a
53290
dO2b
53291
d02c
53292
dO2d
53293
53294
d02e
d400-d7ff
cf400
d401
d402
d403
54272-55295
54272
54273
54274
54275
Bits
Description
Multi-Color
4
Select
3
Smooth
20
Sprites
VIC
Memory
Video
7-4
space)
Character
3-1
space)
VIC
Interrupt
Occurred)
SetonAny
7
Light-Pen
3
SpritevsSprite
2
*
SpritevsBackground
Raster
0
IRQ
Mask
SpritevsBackground
1=Sprite
Sprites
I=M.C.M.
Sprites
1=Expand
SpritevsSprite
Mode:I-Enable
38/40
ScrolltoX
0-7
Expand2xVertical
Matrix
Dot-Data
Enabled
Triggered
Compare
Register:
0-7
Multi-Color
0-7
Expand2xHorizontal
SpritevsBackground
Border
Background
Background
Background
Background
Sprite
Sprite
Color
Multi-Color
Multi-Color
Sprite0Color
Sprite1Color
Sprite2Color
Sprite3Color
Sprite4Color
Sprite5Color
Sprite6Color
Sprite7Color
MOS
6581
VoiceI:Frequency
VoiceI:Frequency
Voice!:Pulse
Unused
7-4
Voice1:Pulse
3-0
Column
Control
(Screen)
Text
Pos
(0-7)
Register
Base
Base
Flag
Register
VIC
IRQ
Collision
Collision
IRQ
Flag
1—IRQ
Display
Mode
Collision
Collision
Color
0
Color
1
Color
2
Color
3
Register
Register
Sound
Interface
Control,
Control.
Waveform
Waveform
(TextorBit-Map)
Display;I=
(Y):I-
Address
Address
(Bit=1:
IRQ
Condition
Flag
IRQ
Flag
(in
IRQ
40 Cols
Expand
(in
VIC
VIC
IRQ
Flag
Enabled
Priority:
Select:
(X):
Detect
Detect
0
1
Device
(SID)
Low-Byte
High-Byte
Width,
Width,
Low-Byte
High-Nybble
45
Page 54
Hex.
Decimal
d404
54276
d405
54277
d406
54278
d407
54279
d408
54280
d409
54281
d40a 54282
d40b
54283
d40c
54284
d40d
54285
d40e
54286
d40f
54287
d4iO
54288
Bits
Description
Voicei:Control
7
6
5
4
:
2
Select
Select
Select
Select
Tesl
Ring
Random
Pulse
Sawtooth
Triangle
Bit:I=
Modulate
l=On
1
Synchronize
l=On
0
Gate
Bit:I=
Release
Envelope
Control
7-4
3-0
Select
Select
Attack
Decay
Envelope
Control
7-4
Select
Voice2:Frequency
Voice2:Frequency
Release
Voice2:Pulse
7-4
Unused
3-0
Voice2:Pulse
Voice2:Control
7
Select
6
Select
5
Select
4
Select
Test
2
Ring
I^On
1
Synchronize
I-On
0
Gate
Release
Random
Pulse
Sawtooth
Triangle
Bit:I=
Modulate
Bit:i=
Envelope
Control
7-4
3-0
Select
Select
Attack
Decay
Envelope
Control
7-4
Select
3-0
Select
Voice3:Frequency
Sustain
Release
Voice3:Frequency
Voice3:Pulse
Register
Noise
Waveforml=
Waveforml=
WaveformI= On
WaveformI=
Disabe
Oscillator
Osc.1with
Osc.1with
Start
AtUDec/Sus0=Start
GeneratorI:Attack/Decay
Cycle
Cycle
Duration:
On
On
Osc.3Output
Osc.3Frequency
Duration:
GeneratorI:Sustain/Release
Cycle
Duration:
Control,
Control,
Waveform
Waveform
Register
Noise
Low-Byte
High-Byte
Width.
Width.
Waveforml=
On
1
Cycle
0-15
0-15
Cycle
0-15
Low-Byte
High-Nybble
On
Waveforml= On
Waveforml=
WaveformI=
Disable
Oscillator
Osc2with
Osc.2with
Start
Att/Dec/Sus0=
Generator2:Attack/Decay
Cycle
Duration:
Cycle
Duration;
Generator2:Sustain/Release
Cycle
Amplitude
Cycle
Duration:
Control,
Control.
Waveform
On
On
2
Osc.1Output
Osc.1Frequency
Start
Cycle
0-15
0-15
Cycle
Level;015
0-15
Low-Byte
High-Byte
Width,
Low-Byte
Page 55
Hex.
Decimal
d411
54289
d4i2
54290
d413
54291
d414
54292
d415
54293
d416
54294
d417
54295
d418
54296
d4i9
d41A
d41B
d4iC
d500-d7fl
d800-dbff
dcOO-dcff
54297
54298
54299
54300
54528-55295
55296-56319
56320-56335
Bits
Description
7-4
3-0
7
5
4
3
2
Unused
Voice3:Pulse
Voice3:Control
Select
Select
Select
Select
Test
Ring
Random
Pulse
Sawtooth
Triangle
Bit:I=
Modulate
l=On
Synchronize
l=On
0
Gate
Bit:I=
Release
Envelope
Control
7-4
3-0
7-4
3-0
7-4
3
2
1
0
7
6
5
4
3-0
Select
Select
Envelope
Control
Select
Select
Filter
Filter
Filter
Select
Filter
Filter
Filter
Filter
Select
Cut-Off
Select
Select
Select
Select
Analog/Digital
(0-255)
Analoc^Digital
(0-255)
Oscillator3Random
Envelope
Sustain
Release
Sustain
Release
Cutoff
Cutoff
Resonance
Filter
External
Voice
Voice2Output:I=
Voice1Output:I=
Filter
Filter
Filter
Filter
Output
SID
Register
Color
MOS
CIA)#1
Waveform
Register
Noise
Waveforml=
WaveformI=
Waveforml=
Disable
Osa3with
Osc.3with
Stan
Att/Dec/Sus0=
Generator3:AttackyDecay
Cycte
Cycle
Generator
Cycle
Cycle
Frequency:
Frequency:
Control/Voice
Resonance:
Input:I=
3 Output:I=
Mode
and
Voice3Output;I=
High-Pass
Band-Pass
Low-Pass
Volume:
Converter
Converter:
Generator3Output
Width,
Waveforml=
Oscillator
High-Nybble
On
On
On
3
Osc.2Output
Osc.2Frequency
Start
Duration: 0-15
Duration: 0-15
Sustain/Release
Amplitude
Duration:
Low-Nybbie
Level:
0-15
High-Byte
Input
Min=0
Yes
Yes
Yes
Yes0=
Max=15
0=No
0=No
0=No
No
Volume
Off0=
Mode:
Mode:
Mode:l=
OFF=0
Game
Game
Number
On
I-On
I-On
On
Max
Paddle
Paddle
Generator
Images
Cntrl
RAM
(Only
Bits
3-0
Present)
6526
Complex
Interlace
Adapter
On
Cycle
Cycle
0-15
(Bits
2-0)
Control
=15
1
2
4?
Page 56
Hex.
dcOO
dcO1
dcO2
dcO3
dcO4
dcO5
dcO6
dcO7
dcOB
dcO9
dcOa
dcOb
dcOc
dcOd
Decimal
56320
54321
56322
56323
56324
56325
56326
56327
56328
56329
56330
56331
56332
56333
Description
Bits
Data
Game
Write
70
Scan
Select
7-6
10=
Joystick-2
4
3-2
3-0
Paddle
Joystick-2
Closed
Data
Lightpen)
Read
7-0
4
Joystick-1
(O=
Paddle
3-2
Joystick-1
3-0
Closed
Data
Data
TinnerA:Low-Byte
TimerA:High
TimerB:Low-Byte
TimerB:High-Byte
Time-of-Day
Time-of-Day
Time-of-Day
Time-of-Day
(Bit
Synchronous CIA
Mask)
IRQ
Clear
FLAG1
Input)
Serial
3
Time-of-Day
2
TinnerBUnderflow
1
TimerAUnderflow
0
PortA(Keyboard
Port
2
Keyboard
Paddle
Port 2
Fire
Column
Input
Fire
Button:0=Fire
Buttons:0=Fire
Direction:
Joystick
Port:01=
Bit=1
PortB(Keyboard
Keyboard
Fire)
Fire
Direction
Direction
7)
Interrupt
Flag(I=
Flag
IRQ
Port
Row
Values
Fire
Button/Ughtpen
Buttons:0-Fire
Direction:
Bit=1Open
Register
Register-Port
Byte
Clock:
Clock:
Clock:
Clock:
{Cassette
Interrupt
Alarm
1/10
Seconds
Minutes
Hours+AM/PM
Serial Control
IRQ
I/O
Reg.
OccurredyMasK
Read/Serial
Interrupt
interrupt
Interrupt
Paddles):
Values
Joystick
-PodA(56320)
Seconds
for
Port
Open
Paddles
for
Kybrd
Trigger
B
(56321)
Keyboard
1
Sw,
Bit=0
Scan
Sw.
Bit=0
Flag
Data
Buffer
{Read
Flags/Write
Set
Minus
IEEE
SRQ
48
Page 57
Hex.
Decimal
dcOe
56334
dcOf
56335
ddOO-ddff
ddOO
ddO1
56576-56591
56576
56577
Bits
6
5
4
3
Description
CIA
7
Time-of-Day
0=60
Serial
TimeACounts:I=
02
Force-Load
TimeARun
2
TimerAOutput
0=
1
TimeAOutputtoPB6:1=
0
Start/Stop
CIA
7
Set
6-5
TimeB-
00=Count
01=Count
10=Count
11=Count
4-0
SameasControl
(CIA)
Data
Ctl)
7 Serial
6
Serial
5 Seriai
4 Serial
3 Serial
2
RS-232
1-0
VIC
(Default
Data
7
User/RS-232
6
5
4
3
2
0
/FLAG
User/RS-232
User-Undefined
User/RS-232
User/RS-232
User/RS
1
User/RS-232
User/RS-232
Userf
Flag)
Control
Clock
Hz
Port
Register
Clock
Mode;I=
TimerA:I
Mode:I=
ModetoPB6:I=
Pulse
TimeA:1=
Control
TOD
Register
Alarm/Clock:1=
Mode
Select:
System02Clock
Positive
TimerAUnderflow
TimerAUnderflows
Positive
MOS
6526
Complex
#2
PortA(Serial
IEEE
Data
IEEE
Clock
IEEE
Data
IEEE
Clock
IEEE
ATN
Signal
Data
Output
Chip
System
=11)
PortB(User
Data
CleartoSend
Carrier
Ring
232
Data
RequesttoSend
Received
RS-232
Receive:
A
Frequency:1=50Hz
Output0=Input
CNT
Signals0=System
= YES
Once0=
Continuous
Toggle
Yes0=No
Start 0=Stop
B
Alarm0=Clock
Pulses
CNT
Transitions
Pulses
RegisterA:for
tnterface
IEEE,
RS-232,
Input
Pulse
Input
Output
Pulse
Output
Timer
Adapter
VIC
Output
(User
Port)
Memory
Port/RS-232
Set
Bank
Ready
Select
Signals)
Detect
Indicator
Terminal
Ready
Data
Detect
Start-Bit
While
B
Memory
(IRQ
CNT
49
Page 58
Hex.
Decimal
dcO2
56578
dcO3
56579
dcO4
56580
dcO5
56581
dcO6
56582
dcO7
56583
dcO8
56584
dcO9
56585
dcOa
56586
dcOb
56587
dcOc
56588
dcOd
56539
dcOe
dcOf
56590
56591
deOQ-defi
dfOQ-dffi
56832-57087
57088-57343
Description
Bits
Data
Data
TimerA:Low-Byte
TimerA:High-Byte
TimerB:Low-Byte
TimerB:High-Byte
Time-of-Day
Time-of-Day
Time-of-Day
Time-of-Day
(Bit 7)
Synchronous CIA
Mask)
NMI
Flag
A
3
2
0
FLAG2
Synchronous
Trme
TimerBInterrupt
1
TimerAInterrupt
CIA
56334}
CIA
56335)
Direction
Direction
Register
Register
Clock:
Clock:
Clock:
Clock;
Serial
Interrupt
Control
Flag0=NM1
NMI:
Detects
Serial
of-Day
Control
Control
Reserved
Reserved
Alarm
RegisterA(Same
RegisterB(Same
for
for
-PortA(56320)
-PortB456321)
1/10
Seconds
Seconds
Minutes
Hours+AM/PM
I/O
Data
Buffer
Reg.
(Read
OccurredVMask
Start-BitonRecv
Port
Interrupt
Interrupt
Format
Format
Future
Future
t/O
Expansion
I/O
Expansion
Flag
Flags/Write
Set-Clear
at
at
50
Page 59
APPENDIX
RELEASE
DISK
III
DESCRIPTIONOFFILESONTHE
ASSEMBLER64
BOOT
CROSSREF64
DOS
DOS
ALL
5.1
WEDGE64
See
Section7.Thisisthe
program
assembles
EDITOR
LOAD
command;
not
assembler
This
the
time.
areasinmemory,
havingtoreload
This
reference
that
program
LOAD
by
This
wedge
running
See
for
programonthe
command
loaded,
and
which
program.Toload
the
loads
files
+1ASSEMBLER64",8oruse
then
type
previousJy
program
HI-LOADER,
These
programisusedtoprint
optionisspecifiedatassembly
saved
toads
into
loads
and
three
before
listing
loads
created by
into
and
programs
allowing
low
L'CROSSREFB4",8
typing
the
RUN.
file
contains
program.Itis
the
DOS
the
WEDGE64
Section5.This
DOS
5.1
wedge
disksothat
can be
type
activated.
RUN
used.
and
programisthe
actual
into
low
which
were
the
RUN.
Any
willbelost
the
same
starts
the
EDITOR
their
switching
the
memorybyusing
command
machine
loaded
program.Itis
After
the
wedge
assembler
memory
createdbythe
assembler,
source
area
the
resideindifferent
use
out
assembler
and
type
the
wedge
text
files
since
the
used.
DOS
WEDGE,
allatthe
without
programs.
the
time.
same
cross
when
The
the
load
andisstarted
code
for
the
automatically
program.
"boot
the
LOAD
the
program
by
loader"
the
first
"*'\B
is
willbeloaded
EDITOR64
See
Section6.This
and
modify
the
programisusedtocreate
source
code
be assembled.Toload the
"EOITOR64",8,1.
type
SYS
49152toactivate.
clear
the
pointers
edit
any
files.Besuretosave
file
using
the
assembler.
After
before
PUT
command
51
the
proceedingtocreate
files
which
editor,
type
LOAD
will
later
programisloaded,
Then
type
NEW
to
or
the
source
before
code
loading
the
Page 60
LOLOADER64
and
HILOADER64
MONITORS8000
and
MON1TOR$COOO
See
Section8.These
load
the
sequential
the
assemblerasits
oneofthese
file
into
machine
difference
LOLOADER
64
loadsa!hex
case
oneofthem
location
To
load
programsisrun,itloads
memoryinthe
code
which canbeexecuted.
between
loadsathex
for
the
the
S0800 "LOLOADER641'.8 the
SC800
and
See
identical
load
executable
They
commands
version,
then
type
SYS51200.
Section9.These
in
function
and
save
binary
form.
also
allow
for
two
records
outputorobject
specified
the
two
SC800.
They
interferes
machine
version,
and
then
type
LOAD
two
and
machine
the
programmer
examining
without havingtorun the
process.
LOAD
typing
by
startedbytyping
The
first
loadsathex
"MONITOR$8000",8,1
SYS32768.
typing
LOAD
The
second
■■MONITOR$C000",8,1
SYS49152.
programs
which
programsisthat
$0800
are
with
are
used
to
are
created
file.
When
the
object
locationastrue
The
only
and
HILOADER
both
included
the
intended
codetoreside.
type
LOAD
type
RUN. To
load
"HILOADER64",8,1
monitor
are
and
whole
porgrams
used
primarily
code
filesintheir
many
changing
assembly
are
for
useful
programs
$8000bytyping
andisstarted
loadsathex
and
by
$C000
is
by
in
52
Page 61
APPENDIX
IV
INSTRUCTION
ADC
Add
with
Carry
Accumulator
AND
"AND11toAccumulator
ASL
Shi1t
Left
One
{MemoryorAccumulator)
BCC
BranchonCarry
BCS
BranchonCarry
BEQ
BranchonZero
BIT
Test
BitsinMemory
Accumulator
BMI
BranchonResult
BNE
Branch on
BPL
BranchonResult Plus
BRK
ForceanInterruptorBreak
BVC
BranchonOverflow
BVS
BranchonOverflow
CLC
Clear Carry
CLD
Clear
CLJ
Clear
CLV
Clear
CMP
Compare
Accumulator
CPX
Compare
Index
CPY
Compare
Index
DEC
Decrement
DEX
Decrement
DEY
Decrement
EOR
Exclusive-QR
Accumulator
INC
Increment
INX
IncrementXby
INY
IncrementYby
JMP
JumptoNew
JSR
JumptoNew
Saving
LDA
Transfer
Accumulator
LDX
Transfer
LDY
Transfer
LSR
Shift
or
Accumulator)
One
Result
Decimal
Interrupt
Overflow
Memory
Memory
Y
Memory
Y
MemorybyOne IndexXby
IndexYby
MemroybyOne
Return
Memory
MemorytoIndex
MemorytoIndex
Bit
6500
SERIES
SET
OPCODES
to
Bit
Dear
Set
Result
with
Minus
not
Zero
Clear
Set
Flag
Mode
Disable
Flag
and
and
and
Memory
One
One
Location
with
Location
Address
to
Right
(Memory
MICROPROCESSOR
Bit
One
One
X
Y
53
Page 62
NOP
Do
Nothing-No
ORA
"OR"
Accumulator
PHA
Push
PHP
Push
Memory
AccumulatoronStack
Processor
with
Status
Stack
PLA
Pull
Accumulator
PLP
Pull
ROL
ROR
Processor
Rotate
or
Rotate
One
Accumulator)
One
Bit
Bit
From
Left
Right
(MemoryorAccumulator)
RTI
Return
RTS
Return
SBC
Subtract
From
SEC
Set
SED
Set
SEI
Set
STA
Store
Memory
STX
Store IndexXin
STY
Store
TAX
Transfer
Index
TAY
Transfer
Index
TSX
Transfer
TXA
Transfer
Accumulator
TXS
Transfer
From
Interrupt
From
Subroutine
Memory
Accumulator
Carry
Flag
Decimal
Interrupt
Mode
Disable
Accumulator
IndexYin
Accumulator
X
Accumulator
Y
StacktoIndex
IndexXto
IndexXto
Register
TYA
Transfer
IndexYto
Accumulator
Operation
on
From
Stack
Stack
(Memory
and
Carry
Status
in
Memory
Memory
to
to
X
Stack
54
Page 63
APPENDIXVA
COMMODORE
LINE**
LOG
CODE
00161
00162
00163
00164
00165
00166
00167
00163
00169
00170
00171
00172
00173
00174
00175
00176
00177
00173
00179
00180
00181
00162
00183
001S4
00185
00186
00187
ooisa
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
0020a
00209
CCE1
CCE1
CCE1
CCE1
CCE1
CCE3
CCE6
CCE8
CCE9
CCEB
CCEB
CCED
CCF0
CCFO
CCFO
CCFO
CCF3
CCF3
CCF3
CCF3
CCF3
CCF5
CCF7
CCF8
CCFB
CCFD
CCFF
CD01
CDO3
CD06
CDO8
CDOA
CD0C
COOE
CD10
CD12
CD12
CD15
CD17
CD18
CD1A
CD1A
CD1A
CD1C
CD1E
CD20
CD22
CD25
CD28
A2
02
BD OE
95
7C
CA
10
F8
A5BA
8D77CC
4C 4B
85
A6
86
A/
BA
BO0101
C9E6
FO
04
C9 8C
DO
17
BO0201
C9A7
FOOd
C9A4
D0
0C
A5
A6
A2O8
DO19CC
FO
11
CA
10
F8
A5 A6
A6 A7
C9 3A
BO
03
4C80
4C8A
SAMPLE
64
ASSEMBLER
LINE
INIT
THE
GOOO
CC
WEDGE
SAY
HELLC
CF
THISISWH
START
FRYTWO
FINDIT
FINDC
NOTCMD
00
00
STRTS
OUTPUT
MEMORY
LOX
ff$02
LDA
JUMP,X
STACHRGOT+3.X
DEX
BPLWEDGE
LOA
FA
SVFA
STA
.
JMP
MSG
STA
BUFPT
STX
BUFPT+1
TSX
LDAS0101.X
CWP#.GONE
BEQ
TRY
CMP#,MAIN
BNE
NOTCMO
LOA
JOIO'.X
LISTINGOFTHE
MANAGER
.". ■..=;v::.
TWO
CMP#iGONE
BEQ
FINDIT
CMPtfcMAIN
BNE
NOTCMO
LOA
BUFPT
LDX#NCMD-1
COMP
CMD.X
BEQ
CALLW
DEX
6PL
FINDC
LDA
BUFPT
LDX
BUFPT+1
CMP*':
BCS
STHTS
JMPCHRGOT+7
JMPCHROT+17
(STARTUP
:MOVE
;USE
CURRENTFAFOR
DEVICE
;PRINT
;SAVEA,.X
lACTIVATED
■GONE"
COMES
THREE
ADDR
HELLO
IE
WORK
CALL
BYTES
(JSR/RTS)
IN
;FROMARUNNING
PROGRAM??
;FROM
DIRECT
;
PROGRAM?
;DIRECT?
;GETTHE
BACK
:FINO
THE
:
RESTORE
:CMPLETECHRGOT
;TO
THE
MODE??
COMMAND
COMMAND
REGS
ENDOFCHRGOT
HEP
55
Page 64
00210
CD28
00311
CD2886A9
S
CO2A
00213
CD2D
nd?14
CD30A6A5
00215
CD32A927
CALL
8D7ACC
20A3CE
10
STC
CNTDN
STA
FLAG
LSR
RDFiLE
LDX
CNTDN
LDA
#,FILE
;SAVE
INDEX
;SAVE
THE
FOR
;GET
LENGTH
;HESTOBE ;SET
COMMAND
LATER
THE
FILENAME
INDEX
FILENAME
AND
ADDRESS
56
Page 65
APPENDIXVIEXPLANATIONOFERROR
Error
messages
statementsinerror.
which
mightbeproduced
*"AMODE
Following
followedbyoneormore
accumulator(A-
opcodeinthe the
accumulator.
statement),
reference
opcode
A
labelona
and
the
used.
**A,X,Y,S,P
P).
They
cannotbeusedaslabels.
error
messagetobe
statement.
symbol
tableasan elsewhereinthe if
the
label
■'BRANCH
Allofthe
assembled
the
other
to
the
of
the
branch
for
addressofthe byteis0-127,
branchisbackward.(Anegative
form).
Therefore,
backward
128
Ifanattemptismadetobranch
message
In
evaluatinganexpression,
couldn't
willbeprinted.Tocorrect,
"CAN'T
interpret
happenifthe
not
valid
within
field
and
make
{between
commas).
are
giveninthe
The
followingisa
program
during
NOT
ALLOWED
the
legal
opcode,
and
spaces.
accumulator
statementisone
Check
which
forastatement
this
statementisreferencing.
accumulator,
RESERVED
mode)asthe
which
lookupthe
statementisoneofthe
have
special
meaningtothe
Useofoneofthese
printed.Nocode
The
label
does
not
get
undefined
program
were
never
declared.
OUTOFRANGE
instructions
into
type
bytesofcode.
the
addresstobranch
variable.
will
cause
{excluding
beginningofthe
the
branchisforward;ifthe
branchisin
a
branch
bytes
instruction
relativetothe
further
EVAL
EXPRESSION
the
assembler
as being
field
followinganopcode
expressions
sure only
par! ofavalid
{i.e.
parentheses).
valid
special
listing
listofall
assembly.
oneormore
The
assembleristryingtouse
does
spaces,isthe
operand.
not
labelledA(an
valid
operands
five
reserved
assembler
names
willbegenerated
defined
and
will
Referencetosuchalabel
error
messagestobe
the
two
One
byteisfor
to.
The
branchistaken
next
instruction.
two's
can
only
branch
beginningo(the
than
these
restructure
the
foundacharacter
expression.
contains
Check
characters
MESSAGES
accompanying
error
messages
However,
allow
reference
illegal
If
you
were
for
names
and
therefore
will
for
appearinthe
jumps),
the
opcode
are
If
valueis128-255,
complement
forward
next
instruction.
limites, this
program.
This
special
characters
the
operand
are withinafield
the
letter
A
the
the
to
trying to
the
(A,X,Y,
cause
printed
S
this
the
as
and
relative
the
value
the
127
or
error
it
can
57
Page 66
"DUPLICATE
The
first
fieldonthe
label.If1he
as a
label
symbol
symbol
the
current
table.
will,inthis
"FILE
The
FILE
already
scratching
"FILE
The
FILE
following
The
•A.LIB
•A.FIL
The
user
that
the
"FORWARD
The
expressiononthe
symbol
the
assembleristo
addressesorvaluestothem.
Source
are
encountered
and
not-previously-encountered
defined
previously
table.
second
A
labelorexpression
consideredtobe
To
aliow
allows
is
allowed.
Card
current
(oronthe
table
has
appearedssa
line,
The
assembler
case,
EXISTS
EXISTS
existsonthe
the
NOT
NOT
occurs:
source
specifiesanonexistent
specifies
should
wrong
that
hasn't
Code
values
used
The
assembler
time
ior
conformityofevaluating
for
one
Sequence
100
200
SYMBOL
cardisnotanopcodesoitisinterpreted
lineisthe
left
and
tagged
the
assembler
does
print
this
error
message
diskette.
old
fileorchanging
FOUND
FOUND
file
was
error
not
a nonexistent
make
sure
diskette
REFERENCE
right
been
evaluate
sequentially,
fall
into
and
builds a
symbolisdiscovered,itis
then
using
currently
which
referenced
levelofforward
label
'
BNE
NEWONE
first
sideofan
as definedinthat
label,oron
finds
not
allow
error
message.
occurs
This
messageisdisplayed
found
file
file
that
the
was
placedinthe
sideofan
defined
oreviously.
expressionsorlabels,
The
assembler
which
two
means
classes,
symbols,
tableofundefined
processes
defined
usesayet
forwardtothe
referencesothat
opcode
NEWONE
LDA
lineinwhich
equals
the
the
label
redefinitions
when
error
canbecorrected
the
diskette.
that
sign),itis
line.
However,ifthe
leftofan
alreadyinthe
of
the object
when
filenameisnot
disk
equals
misspelled,
drive.
sign
contains
Oneofthe
and
processes
that
allofthe
i.e.,
already-defined
The
assembler
symbols.
substituted
allofthe
values.
undefined
expressions,
input
value
to-be-defined
this
the
operand
#5
as a
symbol
put
equate
symbols
appears
into
the
prior
symbol
and
file
named
to
by
oneofthe
or
a
operations
assign
the
input
symbols
assigns
When
into
statements
is
value.
that
symbols
a
the
a
assembler
following
code
of
58
Page 67
The
followingisnot
Card
Sequence
100
200
300
This
feature
correction
Card
100
should
for
this
Sequence
'
300
301
This
error
may
is
not
definedatallinthe
sameasfor
The
assembler forward
right
sideofany
symbols
undefined
reference.AMexpressions
for
the
allowed:
label
BNE
NEWONE
NEXT
not
disturb
probleminthis
label
BNE
NEXT
NEWONE
also
mean
that
program,inwhich
values.
cannot
process
equal
sign
equatetobe
opcode
NEWONE
INC
LDA
the
normal useoflabels.
example
opcode
NEWONE
LDA
INC
the
valueonthe
more
than
with
symbols
must
refer
onlytopreviously
processed.
operand
NEXT+5
#5
The
is:
operand
#5
NEXT+5
right
sideofthe'=
case,
the
cureisthe
one
levelofcomputed
that
appear on
defined
'
the
"ILLEGAL
After
findinganopcode
assembler
following
(indexed, absolute,
the
the
opcode,
Checktosee
and
make
section
Check
supposedtobeanindirect
the
parenthesisorindex
for
expression,
The
character
assumesitisalabel
continues
are
continue.
opcode
stringisnotavalid
1.1.onaddressing
for
two
types
missingorwrong
"IMPROPER
assembler
string.Ifthis
found,
However,ifa
(since
OPERAND
passes
the
opcode)
etc.).Ifthe
this
error
what
typesofoperands
sure
the
formofthe
the
operand
available.
register),
index
index
register).
OPCODE
searchesatine
and
parsing
the
for
next
only
the
line
one
opcode,
TYPE
that
does
operand
and
determines
message
modes).
field
starting
operand,
If
the
registersinan
stringisnot
placesitin
next
willbereadinand
second
labelisallowed
the
not
haveanimplied
field
(the
next
non-blank
what
typeofoperanditis
typeofoperand
foundisnot
wiflbeprinted.
are
allowed
operand
format
this
typeiscorrect
withaleft
recheck
was
error
the
wrong
willbeprinted.
parenthesis.
indexed
untilitfinds
oneofthe56valid
the
non-blank
the
symbol
character
the
assembly
fieldisfound,itis
per
line).Ifthis
error
messageisdisplayed.
operand,
field
for
the
opcode
(see
correct
(missing
format
right
Also
operand
first
non-blank
opcodes,
table.Itthen
string.Ifnone
will
assumedtobe
character
the
valid
for
the
If it
is
for
check
{form:
it
an
59
Page 68
This
error
can
occuritopcodes
assembler the
card),Itwill
thereisanother
Check
After
this
parenthesis.
address
indexedbyoneofthe
the
character
will
interpret
then
field,
for
a misspelled
"INDEXED
MUSTBEX
findingavalid
case,
the
first
characterinthe
The
assembler
which,
with the
that
the
trytoassemble
this
opcodeorfor
opcode,
index
assembler
registerisnotXorYand
Check
supposedtobe an
the
parenthesisorindex
for
expression,
The
that
around
address.Ifthe
than
error
This
a
of
zero
An
assembler
ofaninstruction,
mustbegreater
SFFFF(2bytes
limitedto+
generates
error
is
or
This
valuesofsymbols
for
for
the
operand
two
types
available.
missingorwrong
index
registers).
'"
INDIRECT
assembler
surround
it,
the
255,
(two
message
error
will
index
register
page
zero.Tocorrect
memory.
''INVALID
address
directives
more
message
limitedtoone
equattozero.
OUTOFRANGE
recognizesanindirect
it.Ifthe
assembler
operand
bytes
willbeprinted.
only
following
(The
implied
ADDRESS
referencedinan
the
than or
long).
127or-
than
willbeprinted.
byte.
validityischecked
usedinthe
this
information).
field
indirect
registers),
index
field
field
wouldberequiredtospecify
occurifthe
(.BYTE,
operand
(This
128
two
All
are
misspelled,
the
opcode
error
as a
label
the
next
willbeprinted.
more
OR
Y
the
assembler
operand
interprets
exceptionofthe
registers,
this
error
starting
operand,
If
the
formatiswrong
this
the
jump
XorY.Inthe
was
tryingtointerpretasan
messageisprinted.
withaleft
recheck
error
willbeprinted,
registersinan
addressbythe
followinganopcode
will
trytoassembleitasanindirect
extends
the
address),
this,
the
high
instruction,
.DBYTE.,
thatisgeneratedbythe
equaltozero,
excludes
from
bytesofcodeoris
For
address
after
the
operand
into
operand
address
order
fieldisin
and
byteis00).
or
.WORD),isinvalid.Inthe
and
relative
the
next
instruction.)
the
.BYTE
references
operandisevaluated.
field
in
which
(ifnolabel fieldasthe
than
one
labelona
looks
lor
the
fieldisa
-iext field
left
as an
statement,
erroneous
parenthesis.
the
correct
(missing
indexed
absolute
the
field
the
less
(see
operand
parentheses
has
parentheses
modet
the
address),
correct
address
must
refertopage
addressinoneofthe
thanorequal
branches
If
less
than
directive,
mustbegreater
the
symbol
case
the
appears
opcode.
on
It
line.
operand.
indirect
must
In
be
case,
index
If it
is
format
for
right
Also,
check
(form:
I.e.,
larger
this
form
(i.e.,
fieldisout
case
assembler
to
which
the
operand
zero,
this
each
operand
Check
table
are
than
for
60
Page 69
"
LABEL
The
first
assembler
of
the
field
error
messageisprinted.
Check does
the
All
the
blank)
foranunlabelled
start
instruction.
"LABEL
symbols
assembler
to find
separatorsisused,
the
illegal
charactersinlength.
opcodes.
doesn't
to
interpret
**NON-ALPHANUMERIC
Labels
mustbeseparated
special
opcode,
Eachofthe56valid
are
characterorother
characters.
necessary)byoneormore
character
In
the
caseofa
canbefollowed
card as a
the
next
**PC
An
assembled
to
64K
(65535).
bytes
canbeusedtodefineanaddress.
thingasnegative
position
the
current
When
this
code
with
multiple
care
shouldbetakentokeep
limits.
START
non-blank
triedtointerpret
does
NEED
fieldisnotavalid
it
not
begin
withanalphabetic
statement
withaspecial
TOO
are
limitedtosix
looks
the
endofa
separator
character.
LONG
for
oneofthe
labelorstring.Ifother
the
error
causes
Check
Also,
check
begin
withasemicolon.Inthis
partofthe
madeupof
this
error
They
toracomment
commentasa
onetosix
from
the
separatorisbetween
message
opcodes
mustbeseparated
blanks.Ifthe
{suchasa
comment
tab
position).
NEGATIVE-RESET
comma),
lone
labeloran
directly
by a
(useofa
programisloaded
Thisisthe
memory,anattempttoreferenceanegative
will
cause
memory
error
occurs,
the
new
valueofthe
bytestobe
this
extentofthe
error
location)tobe
the
assembler
assembled
A-Z
as a
charactersinlength.
message
"the
fornospacing
opcode
mightbeprinted.
are
this
semicolontodenote
semicolon
and
the
opcode.
label.
Therefore,
However,
character
with
onlyanoperand
Also
check
separating
foranillegal
characters
than
willbeprinted
symboltoextend
beyond
between
card
withalong
case
the
assembleristrying
label.
alphanumeric
fieldbyoneormore
madeupof
1rom
opcode
error
message
opcode
0
into
that
tabs
coreinthe
digits.
the
three
the
operand
ends
willbeprinted.
needsnooperand,
the
comment
rangeofposition
machine.Amaximumoftwo
Because
the
program
resettozero.
continues
program
into
program
counter.
the
same
counter
thereisno
counter
assembling
This
locations.
the
the
first
character
and
the
field
that
tabel
When
parsing,
(usually
oneofthese
providing
that
six
labels
label
alphabetic
and
first
word
The
label
blanks.Ifa
and
the
field
(if
one
withaspecial
the
restofthe
out
to
such
(or
pointer
the
could
cause
Therefore,
within
the
proper
in
a
that
field
is
they
0
to
61
Page 70
"RAN
This
error
needed
the
fieldisfound.
opcode
that
was
an
operand:anASCII
sure
any
of
the
quote
operand
aren't
looking
"READ
This
message
drive
manual
•-UNDEFINED
All
assembler
characterina
character
notavalid
Check
field
thatisnotadirective.
''UNDEFINED
This
errorisgeneratedbythe
assembler
the
opcodeoran
assembler
interpretation
the
leftofan
pass
one
symboJinan
defined
assembly
levelofforward
However,ifpass
leftofan
as a
defined
field
the
symbol
messageisprinted
OFF
END
message
field
and
field
withoutanoperand
will
runs
The
thoughttotakeanimplied
embedded
string,
and
other
there
onetoclose
field
indicates
operands,
for
them.
ERROR
quotes
mustbethree
referstoa
foradescriptionofthese
DIRECTIVE
directives
non-blank
stringasa
assembler
foramisspelled
findsasymbolinthe
puts
by
equateoras
will
defineitand
operand
withavalue
process
directive.Ifthe
SYMBOL
equals
the
symbol
pass
when
can
reference.
one
equate,
symbolisin,
and
the
symbol.
the
field
withnovalue
assembler
When
cannotbeinterpreted.
OF
CARD
occurifthe
off
the
endofthe
following
assemblerislooking
should be
fieldonthe
operand!
string
thatismissing
are
doubled;tohaveaquoteatthe
quotes,
off
the
string):acommaatthe
there
are
more
the
assembler
disk
drive
read
begin
withaperiod.Ifa periodisthe
field,
the
asembler
character
directive,
directiveora
sign),
two.ifthe
fieldh
be completed.
doesn't
theretsno
this
second
operand
that
into
the
symbolisdefined
the
first
non-blank
enteritin
found
before
pass
two
(See
Forward
find
the
never
pass
two
corresponding
for
error
has
table
assembles
the
for
a
card
(or line
checked
same
whichinfact
the
image)
for:avalid
card:anopcode
needed
closing
quote
before
(make
end
two
for
the
embedded
endofthe
operandstocome:ifthere
will
run
off
the
error
Refertoyour
errors
and
current
their
line
disk
causes.
first
interprets
string
message
periodatthe
pass.Ifin
field
(the
not
been
and
flagsitfor
fiefdina
the
symbol
the
definition,
Thisiswhatismeantbyone
Reference
symbol
entersitin
triestointerpret
as a
Therefore, the
operand.
the
following
that
follows
willbeprinted.
beginningofa
the
first
pass
the
field
following
defined
table.
it.Inthis
yet,
the
(shows
up on
statement),
Therefore,
will
be
case,
Error).
labeioron
the
symbol
the
value
for
the
table
operand
the
error
the
is
a
Page 71
This
error
will
also usedasa
statement it
as a
symbols,
Note:
OPERAND
the
expression.
been
and
the
error
OPERAND
bytes
reference.
and
instruction
forward
(the
didn't
value
label
and
that
references
symbol
When
that
misspelled
the
assembler
fieldoron
If
defined
waittoevaluateitin
right
and
(or
the
yet,
sideofan
willbeflaggedassuch.
fieldofa
the
valueofthe
When
valueofthe
is
one
referencetopage
extra
one
that
know
how
which
was
occurifa
reserved
symbol
referredtoelsewhereinthe
the
reserved
has
not
been
labelsormissing
symbol,
defined.
Check
labelstocorrect
findsanexpression
the
rightofan
thereisa
the
equal
valid
symbol
assembler
the
second
sign,
OPCODE,
expression
the
second
expressionisone
byte
pass
longer
than
zero
was
saved).
large
the
value
two
bytes.
equals
within
will
flagitas a forward
pass.Ifthe
the
forward
However,ifthe
the
first
and
flagitas a forward
fillsinthe
byte long
required.
memory
During
was,soit
wastes
the
A, X, Y, S,orP,
is
program.Onthe
the
assembler
for
useofreserved
this
sees
error.
(whetheritisinan
sign)ittriestoevaluate
the
expression
that
hasn't
reference
expressionison
referenceisa severe
expressionisin
pass
will
set
valueofthe
i.e.,
expression,
256,
the
Thisisbecause
one
byteofmemory
first
pass,
the
assembler
saved
for
the
largest
aside
an
two
the
63
Page 72
APPENDIX
VII
EDITOR64
COMMAND
SUMMARY
Command
AUTO
AUTO
n1
CHANGE/s1/s2/,n1-n2
CHANG
E/s1/s2/
CPUr'FILE"
DELETE
n1-n2
FIND/s1/,n1-n2
FlND/si/
FORMAT
n1-n2
GET"FILE",n1-n2,n3
GET"FILE"
KILL
LIST
NUMBER
PUTllFILE"ln1-n2)n3]n4
PUT"
nltn2tn3
FILE"
Description
Starts
Shuts
Change
Change
automatic
off
stringinline
stringnorange
Compacted
removed
Delete
Find
Find
Print
Bringintext
Short
Disable
List
Renumber
Save
Save
range
stringinline
stringnorange
formatted
form
the
linesoftext
textondisk
text
auto
PUT,
from
GET
editor
text
short
form
line
numbering
range
unnecessary
range
disk
file
spaces
file
are
Page 73
APPENDIX
VIII
MONITOR
COMMAND
SUMMARY
ASSEMBLE
COMPARE
DISASSEMBLE
FILL
GO
HUNT
INTERROGATE
LOAD
MEMORY
NEW
LOCATOR
REGISTERS
SAVE
TRANSFER
EXIT
A
c
D
F
G
H
1
L
M
N
R
S
T
Assemblealineofmachine
Compare
report
Disassemblealineof6502
Fill
Start
Hunt
occurrencesofcertain
interrrogate
valuesofthe
Loadafile
Display
memory
Adjust
moving
Display
Savetotapeordisk
Transier
memorytoanother
Exit
reset)
two
sectionsofmemory
differences
memory
with
the
executionatthe
through
memory
memory,
memory
from
tapeordisk
the
hexadecimal
locations
machine
it
the
code
64MON
language
CPU
registers
from
(BASIC
specified
showing
one
wil!
code
and
code
address
specified
for
bytes
locations
values
section
needtobe
address
all
the
ASCII
of
program
after
of
65
Page 74
COMMAND
@C(dr):newfile([vol])
@f(dr)
@N(dr);diskname,id
@R{dr):newfile([vol])
©S(dr):filename('X(vol])
@UJ
@$(dr):{filename)(*)([vol])
=
oldfile([volJ)
=
oldfiie([voi])
DESCRIPTION
Current
Copyafile
Initialize
Formatadisk
Kill
Renameafile
Scratch a
Reset
Read
All
n
disk
status
a
drive
the
wedge
the
the
DOS
wherenis8to15inclusive
program
file
DOS
directory
commands
willgoto
/filename
%filename
t
filename
*■
filename
Please
Note:
'Vol'isany
mustbe0
character
(zero)or1
enclosedinsquare
(one)
Loadafile
Loadafile
address)
Loadafile
it
Saveatile
for
(at
{at its
(at
the
respective
BASIC)
own
!oad
BASIC)
and
brackets;
drives.
run
'dr'
66
Page 75
t
commodore
COMPUTER
3370
CommDdore
1200
Wilson
Commodore
Pharmacy
Business
Drive•West.
Business
Avenue•AgmcourL,
PrinledinHong
Machines.
Chester.PA193B0
Machines.
Ontario.
Kong
Inc.
Limited
M1W
2K4
Loading...