XGATE Dependent Features
************************

XGATE Options
=============

The Freescale XGATE version of AS has a few machine dependent options.

-mshort
     This option controls the ABI and indicates to use a 16-bit integer ABI. It has no effect on the assembled instructions. This is the default.

-mlong
     This option controls the ABI and indicates to use a 32-bit integer ABI.

-mshort-double
     This option controls the ABI and indicates to use a 32-bit float ABI. This is the default.

-mlong-double
     This option controls the ABI and indicates to use a 64-bit float ABI.

--print-insn-syntax
     You can use the --print-insn-syntax option to obtain the syntax description of the instruction when an error is detected.

--print-opcodes
     The --print-opcodes option prints the list of all the instructions with their syntax. Once the list is printed AS exits.

Syntax
======

In XGATE RISC syntax, the instruction name comes first and it may be followed by up to three operands. Operands are separated by commas (,). AS will complain if too many operands are specified for a given instruction. The same will happen if you specified too few operands.

     nop
     ldl  #23
     CMP  R1, R2

The presence of a ; character or 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 XGATE assembler does not currently support a line separator character.

The following addressing modes are understood for XGATE:

Inherent

Immediate 3 Bit Wide
     #NUMBER

Immediate 4 Bit Wide
     #NUMBER

Immediate 8 Bit Wide
     #NUMBER

Monadic Addressing
     REG

Dyadic Addressing
     REG, REG

Triadic Addressing
     REG, REG, REG

Relative Addressing 9 Bit Wide
     *SYMBOL

Relative Addressing 10 Bit Wide
     *SYMBOL

Index Register plus Immediate Offset
     REG, (REG, #NUMBER)

Index Register plus Register Offset
     REG, REG, REG

Index Register plus Register Offset with Post-increment
     REG, REG, REG+

Index Register plus Register Offset with Pre-decrement
     REG, REG, -REG

     The register can be either R0, R1, R2, R3, R4, R5, R6 or R7.

Convene macro opcodes to deal with 16-bit values have been added.

Immediate 16 Bit Wide
     #NUMBER, or *SYMBOL

     For example:

          ldw R1, #1024
          ldw R3, timer
          ldw R1, (R1, #0)
          COM R1
          stw R2, (R1, #0)

Assembler Directives
====================

The XGATE version of AS have the following specific assembler directives:

Floating Point
==============

Packed decimal (P) format floating literals are not supported(yet).

The floating point formats generated by directives are these.

.float
     Single precision floating point constants.

.double
     Double precision floating point constants.

.extend
.ldouble
     Extended precision (long double) floating point constants.

Opcodes
=======