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