Home | History | Annotate | Download | only in doc
      1 @c Copyright (C) 2012-2016 Free Software Foundation, Inc.
      2 @c This is part of the GAS manual.
      3 @c For copying conditions, see the file as.texinfo.
      4 @ifset GENERIC
      5 @page
      6 @node XGATE-Dependent
      7 @chapter XGATE Dependent Features
      8 @end ifset
      9 @ifclear GENERIC
     10 @node Machine Dependencies
     11 @chapter XGATE Dependent Features
     12 @end ifclear
     13 
     14 @cindex XGATE support
     15 @menu
     16 * XGATE-Opts::                   XGATE Options
     17 * XGATE-Syntax::                 Syntax
     18 * XGATE-Directives::             Assembler Directives
     19 * XGATE-Float::                  Floating Point
     20 * XGATE-opcodes::                Opcodes
     21 @end menu
     22 
     23 @node XGATE-Opts
     24 @section XGATE Options
     25 
     26 @cindex options, XGATE
     27 @cindex XGATE options
     28 The Freescale XGATE version of @code{@value{AS}} has a few machine
     29 dependent options.
     30 
     31 @table @code
     32 
     33 @cindex @samp{-mshort}
     34 @item -mshort
     35 This option controls the ABI and indicates to use a 16-bit integer ABI.
     36 It has no effect on the assembled instructions.
     37 This is the default.
     38 
     39 @cindex @samp{-mlong}
     40 @item -mlong
     41 This option controls the ABI and indicates to use a 32-bit integer ABI.
     42 
     43 @cindex @samp{-mshort-double}
     44 @item -mshort-double
     45 This option controls the ABI and indicates to use a 32-bit float ABI.
     46 This is the default.
     47 
     48 @cindex @samp{-mlong-double}
     49 @item -mlong-double
     50 This option controls the ABI and indicates to use a 64-bit float ABI.
     51 
     52 @cindex @samp{--print-insn-syntax}
     53 @item --print-insn-syntax
     54 You can use the @samp{--print-insn-syntax} option to obtain the
     55 syntax description of the instruction when an error is detected.
     56 
     57 @cindex @samp{--print-opcodes}
     58 @item --print-opcodes
     59 The @samp{--print-opcodes} option prints the list of all the
     60 instructions with their syntax. Once the list is printed
     61 @code{@value{AS}} exits.
     62 
     63 @end table
     64 
     65 @node XGATE-Syntax
     66 @section Syntax
     67 
     68 @cindex XGATE syntax
     69 @cindex syntax, XGATE
     70 
     71 In XGATE RISC syntax, the instruction name comes first and it may
     72 be followed by up to three operands. Operands are separated by commas
     73 (@samp{,}). @code{@value{AS}} will complain if too many operands are specified
     74 for a given instruction. The same will happen if you specified too few
     75  operands.
     76 
     77 @smallexample
     78 nop
     79 ldl  #23
     80 CMP  R1, R2
     81 @end smallexample
     82 
     83 @cindex line comment character, XGATE
     84 @cindex XGATE line comment character
     85 The presence of a @samp{;} character or a @samp{!} character anywhere
     86 on a line indicates the start of a comment that extends to the end of
     87 that line.
     88 
     89 A @samp{*} or a @samp{#} character at the start of a line also
     90 introduces a line comment, but these characters do not work elsewhere
     91 on the line.  If the first character of the line is a @samp{#} then as
     92 well as starting a comment, the line could also be logical line number
     93 directive (@pxref{Comments}) or a preprocessor control command
     94 (@pxref{Preprocessing}).
     95 
     96 @cindex line separator, XGATE
     97 @cindex statement separator, XGATE
     98 @cindex XGATE line separator
     99 The XGATE assembler does not currently support a line separator
    100 character.
    101 
    102 @cindex XGATE addressing modes
    103 @cindex addressing modes, XGATE
    104 The following addressing modes are understood for XGATE:
    105 @table @dfn
    106 @item Inherent
    107 @samp{}
    108 
    109 @item Immediate 3 Bit Wide
    110 @samp{#@var{number}}
    111 
    112 @item Immediate 4 Bit Wide
    113 @samp{#@var{number}}
    114 
    115 @item Immediate 8 Bit Wide
    116 @samp{#@var{number}}
    117 
    118 @item Monadic Addressing
    119 @samp{@var{reg}}
    120 
    121 @item Dyadic Addressing
    122 @samp{@var{reg}, @var{reg}}
    123 
    124 @item Triadic Addressing
    125 @samp{@var{reg}, @var{reg}, @var{reg}}
    126 
    127 @item Relative Addressing 9 Bit Wide
    128 @samp{*@var{symbol}}
    129 
    130 @item Relative Addressing 10 Bit Wide
    131 @samp{*@var{symbol}}
    132 
    133 @item Index Register plus Immediate Offset
    134 @samp{@var{reg}, (@var{reg}, #@var{number})}
    135 
    136 @item Index Register plus Register Offset
    137 @samp{@var{reg}, @var{reg}, @var{reg}}
    138 
    139 @item Index Register plus Register Offset with Post-increment
    140 @samp{@var{reg}, @var{reg}, @var{reg}+}
    141 
    142 @item Index Register plus Register Offset with Pre-decrement
    143 @samp{@var{reg}, @var{reg}, -@var{reg}}
    144 
    145 The register can be either @samp{R0}, @samp{R1}, @samp{R2}, @samp{R3},
    146 @samp{R4}, @samp{R5}, @samp{R6} or @samp{R7}.
    147 
    148 @end table
    149 
    150 Convience macro opcodes to deal with 16-bit values have been added.
    151 
    152 @table @dfn
    153 
    154 @item Immediate 16 Bit Wide
    155 @samp{#@var{number}}, or @samp{*@var{symbol}}
    156 
    157 For example:
    158 
    159 @smallexample
    160 ldw R1, #1024
    161 ldw R3, timer
    162 ldw R1, (R1, #0)
    163 COM R1
    164 stw R2, (R1, #0)
    165 @end smallexample
    166 @end table
    167 
    168 @node XGATE-Directives
    169 @section Assembler Directives
    170 
    171 @cindex assembler directives, XGATE
    172 @cindex XGATE assembler directives
    173 
    174 The XGATE version of @code{@value{AS}} have the following
    175 specific assembler directives:
    176 
    177 @node XGATE-Float
    178 @section Floating Point
    179 
    180 @cindex floating point, XGATE
    181 @cindex XGATE floating point
    182 Packed decimal (P) format floating literals are not supported(yet).
    183 
    184 The floating point formats generated by directives are these.
    185 
    186 @table @code
    187 @cindex @code{float} directive, XGATE
    188 @item .float
    189 @code{Single} precision floating point constants.
    190 
    191 @cindex @code{double} directive, XGATE
    192 @item .double
    193 @code{Double} precision floating point constants.
    194 
    195 @cindex @code{extend} directive XGATE
    196 @cindex @code{ldouble} directive XGATE
    197 @item .extend
    198 @itemx .ldouble
    199 @code{Extended} precision (@code{long double}) floating point constants.
    200 @end table
    201 
    202 @need 2000
    203 @node XGATE-opcodes
    204 @section Opcodes
    205 
    206 @cindex XGATE opcodes
    207 @cindex instruction set, XGATE
    208 
    209