The assembler accepts the standard 6502/65816 assembler syntax. One line may contain a label (which is identified by a colon), and, in addition to the label, an assembler mnemonic, a macro, or a control command (see section Control Commands for supported control commands). Alternatively, the line may contain a symbol definition using the '=' token. Everything after a semicolon is handled as a comment (that is, it is ignored).
Here are some examples for valid input lines:
Label: ; A label and a comment
lda #$20 ; A 6502 instruction plus comment
L1: ldx #$20 ; Same with label
L2: .byte "Hello world" ; Label plus control command
mymac $20 ; Macro expansion
MySym = 3*L1 ; Symbol definition
MaSym = Label ; Another symbol
The assembler accepts
.P02
command was given).
.PSC02
command was given).
.PC02
command was given).
.P816
command was given).
.SUNPLUS
command was given).
In 65816 mode several aliases are accepted in addition to the official mnemonics:
BGE is an alias for BCS
BLT is an alias for BCC
CPA is an alias for CMP
DEA is an alias for DEC A
INA is an alias for INC A
SWA is an alias for XBA
TAD is an alias for TCD
TAS is an alias for TCS
TDA is an alias for TDC
TSA is an alias for TSC
Evaluation of banked expressions in 65816 mode differs slightly from the official syntax:
Instead of accepting a 24 bit address (something that is difficult for the assembler to determine and would have required one more special .import command), the bank and the absolute address in that bank are separated by a dot:
jsl 3.$1234 ; Call subroutine at $1234 in bank 3
For literal values, the assembler accepts the widely used number formats: A preceeding '$' denotes a hex value, a preceeding '%' denotes a binary value, and a bare number is interpeted as a decimal. There are currently no octal values and no floats.
Please note that when using the conditional directives (.IF
and friends),
the input must consist of valid assembler tokens, even in .IF
branches
that are not assembled. The reason for this behaviour is that the assembler
must still be able to detect the ending tokens (like .ENDIF
), so
conversion of the input stream into tokens still takes place. As a consequence
conditional assembly directives may not be used to prevent normal text
(used as a comment or similar) from being assembled.