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
28The Freescale XGATE version of @code{@value{AS}} has a few machine
29dependent options.
30
31@table @code
32
33@cindex @samp{-mshort}
34@item -mshort
35This option controls the ABI and indicates to use a 16-bit integer ABI.
36It has no effect on the assembled instructions.
37This is the default.
38
39@cindex @samp{-mlong}
40@item -mlong
41This option controls the ABI and indicates to use a 32-bit integer ABI.
42
43@cindex @samp{-mshort-double}
44@item -mshort-double
45This option controls the ABI and indicates to use a 32-bit float ABI.
46This is the default.
47
48@cindex @samp{-mlong-double}
49@item -mlong-double
50This 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
54You can use the @samp{--print-insn-syntax} option to obtain the
55syntax description of the instruction when an error is detected.
56
57@cindex @samp{--print-opcodes}
58@item --print-opcodes
59The @samp{--print-opcodes} option prints the list of all the
60instructions 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
71In XGATE RISC syntax, the instruction name comes first and it may
72be followed by up to three operands. Operands are separated by commas
73(@samp{,}). @code{@value{AS}} will complain if too many operands are specified
74for a given instruction. The same will happen if you specified too few
75 operands.
76
77@smallexample
78nop
79ldl  #23
80CMP  R1, R2
81@end smallexample
82
83@cindex line comment character, XGATE
84@cindex XGATE line comment character
85The presence of a @samp{;} character or a @samp{!} character anywhere
86on a line indicates the start of a comment that extends to the end of
87that line.
88
89A @samp{*} or a @samp{#} character at the start of a line also
90introduces a line comment, but these characters do not work elsewhere
91on the line.  If the first character of the line is a @samp{#} then as
92well as starting a comment, the line could also be logical line number
93directive (@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
99The XGATE assembler does not currently support a line separator
100character.
101
102@cindex XGATE addressing modes
103@cindex addressing modes, XGATE
104The 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
145The 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
150Convience 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
157For example:
158
159@smallexample
160ldw R1, #1024
161ldw R3, timer
162ldw R1, (R1, #0)
163COM R1
164stw 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
174The XGATE version of @code{@value{AS}} have the following
175specific assembler directives:
176
177@node XGATE-Float
178@section Floating Point
179
180@cindex floating point, XGATE
181@cindex XGATE floating point
182Packed decimal (P) format floating literals are not supported(yet).
183
184The 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