as: M68HC11-Syntax

1 
1 9.24.2 Syntax
1 -------------
1 
1 In the M68HC11 syntax, the instruction name comes first and it may be
1 followed by one or several operands (up to three).  Operands are
1 separated by comma (',').  In the normal mode, 'as' will complain if too
1 many operands are specified for a given instruction.  In the MRI mode
1 (turned on with '-M' option), it will treat them as comments.  Example:
1 
1      inx
1      lda  #23
1      bset 2,x #4
1      brclr *bot #8 foo
1 
1    The presence of a ';' character or a '!' character anywhere on a line
1 indicates the start of a comment that extends to the end of that line.
1 
1    A '*' or a '#' character at the start of a line also introduces a
1 line comment, but these characters do not work elsewhere on the line.
1 If the first character of the line is a '#' then as well as starting a
11 comment, the line could also be logical line number directive (⇒
 Comments) or a preprocessor control command (⇒Preprocessing).
1 
1    The M68HC11 assembler does not currently support a line separator
1 character.
1 
1    The following addressing modes are understood for 68HC11 and 68HC12:
1 "Immediate"
1      '#NUMBER'
1 
1 "Address Register"
1      'NUMBER,X', 'NUMBER,Y'
1 
1      The NUMBER may be omitted in which case 0 is assumed.
1 
1 "Direct Addressing mode"
1      '*SYMBOL', or '*DIGITS'
1 
1 "Absolute"
1      'SYMBOL', or 'DIGITS'
1 
1    The M68HC12 has other more complex addressing modes.  All of them are
1 supported and they are represented below:
1 
1 "Constant Offset Indexed Addressing Mode"
1      'NUMBER,REG'
1 
1      The NUMBER may be omitted in which case 0 is assumed.  The register
1      can be either 'X', 'Y', 'SP' or 'PC'.  The assembler will use the
1      smaller post-byte definition according to the constant value (5-bit
1      constant offset, 9-bit constant offset or 16-bit constant offset).
1      If the constant is not known by the assembler it will use the
1      16-bit constant offset post-byte and the value will be resolved at
1      link time.
1 
1 "Offset Indexed Indirect"
1      '[NUMBER,REG]'
1 
1      The register can be either 'X', 'Y', 'SP' or 'PC'.
1 
1 "Auto Pre-Increment/Pre-Decrement/Post-Increment/Post-Decrement"
1      'NUMBER,-REG' 'NUMBER,+REG' 'NUMBER,REG-' 'NUMBER,REG+'
1 
1      The number must be in the range '-8'..'+8' and must not be 0.  The
1      register can be either 'X', 'Y', 'SP' or 'PC'.
1 
1 "Accumulator Offset"
1      'ACC,REG'
1 
1      The accumulator register can be either 'A', 'B' or 'D'.  The
1      register can be either 'X', 'Y', 'SP' or 'PC'.
1 
1 "Accumulator D offset indexed-indirect"
1      '[D,REG]'
1 
1      The register can be either 'X', 'Y', 'SP' or 'PC'.
1 
1    For example:
1 
1      ldab 1024,sp
1      ldd [10,x]
1      orab 3,+x
1      stab -2,y-
1      ldx a,pc
1      sty [d,sp]
1