Next: , Up: S12Z Syntax   [Contents][Index] Overview

In the S12Z syntax, the instruction name comes first and it may be followed by one, or by several operands. In most cases the maximum number of operands is three. Operands are separated by a comma (,). A comma however does not act as a separator if it appears within parentheses (()) or within square brackets ([]). as will complain if too many, too few or inappropriate operands are specified for a given instruction.

Some instructions accept and (in certain situations require) a suffix indicating the size of the operand. The suffix is separated from the instruction name by a period (.) and may be one of b, w, p or l indicating byte (a single byte), word (2 bytes), pointer (3 bytes) or long (4 bytes) respectively.


      bset.b  0xA98, #5
        mov.b   #6, 0x2409
        ld      d0, #4
        mov.l   (d0, x), 0x2409
        inc     d0
        cmp     d0, #12
        blt     *-4
        lea     x, 0x2409
        st      y,  (1, x)

The presence of a ; character anywhere on a line indicates the start of a comment that extends to the end of that line.

A * or a # character at the start of a line also introduces a line comment, but these characters do not work elsewhere on the line. If the first character of the line is a # then as well as starting a comment, the line could also be logical line number directive (see Comments) or a preprocessor control command (see Preprocessing).

The S12Z assembler does not currently support a line separator character.

Next: , Up: S12Z Syntax   [Contents][Index]