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