syntax.Rmd
The basic syntax of 6502 assemblers are mostly the same. For
c64asm
the basic syntax is modelled on TASS64.
Extensions to this basic syntax have been made to include some R specific features for easier passing of data to the assembler
$
e.g.
$
e.g.
*
)
=
, e.g.
* = $0820
border = $d020
.rtext
mystring
is a character string in the R
session, then this may be included into the assembly code using:
.rtext mystring
.byte
mybytes
is an integer vector in the R
session, then this may be included into the assembly code using:
.rbyte mbytes
integer
{...}
for evaluated expressions
{...}
are evaluated at compile
time.border = $d020
, then sta {border + 1}
is equivalent to sta $d021
*
is used to refer to the program
counter/current address in this type of operation. However, in order to
avoid clashes with the multiplication operator, within an evaluated
expression use .*
instead. A bare *
will be
treated as a normal multiply.