(as) M68HC11-Syntax
Info Catalog
(as) M68HC11-Opts
(as) M68HC11-Dependent
(as) M68HC11-Modifiers
9.22.2 Syntax
-------------
In the M68HC11 syntax, the instruction name comes first and it may be
followed by one or several operands (up to three). Operands are
separated by comma (`,'). In the normal mode, `as' will complain if too
many operands are specified for a given instruction. In the MRI mode
(turned on with `-M' option), it will treat them as comments. Example:
inx
lda #23
bset 2,x #4
brclr *bot #8 foo
The following addressing modes are understood for 68HC11 and 68HC12:
"Immediate"
`#NUMBER'
"Address Register"
`NUMBER,X', `NUMBER,Y'
The NUMBER may be omitted in which case 0 is assumed.
"Direct Addressing mode"
`*SYMBOL', or `*DIGITS'
"Absolute"
`SYMBOL', or `DIGITS'
The M68HC12 has other more complex addressing modes. All of them are
supported and they are represented below:
"Constant Offset Indexed Addressing Mode"
`NUMBER,REG'
The NUMBER may be omitted in which case 0 is assumed. The
register can be either `X', `Y', `SP' or `PC'. The assembler will
use the smaller post-byte definition according to the constant
value (5-bit constant offset, 9-bit constant offset or 16-bit
constant offset). If the constant is not known by the assembler
it will use the 16-bit constant offset post-byte and the value
will be resolved at link time.
"Offset Indexed Indirect"
`[NUMBER,REG]'
The register can be either `X', `Y', `SP' or `PC'.
"Auto Pre-Increment/Pre-Decrement/Post-Increment/Post-Decrement"
`NUMBER,-REG' `NUMBER,+REG' `NUMBER,REG-' `NUMBER,REG+'
The number must be in the range `-8'..`+8' and must not be 0. The
register can be either `X', `Y', `SP' or `PC'.
"Accumulator Offset"
`ACC,REG'
The accumulator register can be either `A', `B' or `D'. The
register can be either `X', `Y', `SP' or `PC'.
"Accumulator D offset indexed-indirect"
`[D,REG]'
The register can be either `X', `Y', `SP' or `PC'.
For example:
ldab 1024,sp
ldd [10,x]
orab 3,+x
stab -2,y-
ldx a,pc
sty [d,sp]
Info Catalog
(as) M68HC11-Opts
(as) M68HC11-Dependent
(as) M68HC11-Modifiers
automatically generated by
info2html