From Kei Sakamoto <sakamoto.kei@renesas.com>:
[deliverable/binutils-gdb.git] / gas / doc / c-i860.texi
CommitLineData
14218d5f 1@c Copyright 2000, 2003 Free Software Foundation, Inc.
e3308d0d
JE
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 i860-Dependent
7@chapter Intel i860 Dependent Features
8@end ifset
9@ifclear GENERIC
10@node Machine Dependencies
11@chapter Intel i860 Dependent Features
12@end ifclear
13
14@ignore
15@c FIXME: This is basically a stub for i860. There is tons more information
87505968 16that I will add later (jle@cygnus.com).
e3308d0d
JE
17@end ignore
18
19@cindex i860 support
20@menu
a9c99419 21* Notes-i860:: i860 Notes
e3308d0d
JE
22* Options-i860:: i860 Command-line Options
23* Directives-i860:: i860 Machine Directives
24* Opcodes for i860:: i860 Opcodes
25@end menu
26
a9c99419
JE
27@node Notes-i860
28@section i860 Notes
29This is a fairly complete i860 assembler which is compatible with the
30UNIX System V/860 Release 4 assembler. However, it does not currently
31support SVR4 PIC (i.e., @code{@@GOT, @@GOTOFF, @@PLT}).
e3308d0d 32
a9c99419
JE
33Like the SVR4/860 assembler, the output object format is ELF32. Currently,
34this is the only supported object format. If there is sufficient interest,
35other formats such as COFF may be implemented.
87505968
JE
36
37Both the Intel and AT&T/SVR4 syntaxes are supported, with the latter
38being the default. One difference is that AT&T syntax requires the '%'
39prefix on register names while Intel syntax does not. Another difference
40is in the specification of relocatable expressions. The Intel syntax
41is @code{ha%expression} whereas the SVR4 syntax is @code{[expression]@@ha}
42(and similarly for the "l" and "h" selectors).
a9c99419 43@node Options-i860
e3308d0d
JE
44@section i860 Command-line Options
45@subsection SVR4 compatibility options
46@table @code
47@item -V
48Print assembler version.
49@item -Qy
50Ignored.
51@item -Qn
52Ignored.
53@end table
54@subsection Other options
55@table @code
56@item -EL
57Select little endian output (this is the default).
58@item -EB
59Select big endian output. Note that the i860 always reads instructions
60as little endian data, so this option only effects data and not
61instructions.
a9c99419
JE
62@item -mwarn-expand
63Emit a warning message if any pseudo-instruction expansions occurred.
64For example, a @code{or} instruction with an immediate larger than 16-bits
65will be expanded into two instructions. This is a very undesirable feature to
66rely on, so this flag can help detect any code where it happens. One
67use of it, for instance, has been to find and eliminate any place
68where @code{gcc} may emit these pseudo-instructions.
14218d5f
JE
69@item -mxp
70Enable support for the i860XP instructions and control registers. By default,
71this option is disabled so that only the base instruction set (i.e., i860XR)
72is supported.
87505968
JE
73@item -mintel-syntax
74The i860 assembler defaults to AT&T/SVR4 syntax. This option enables the
75Intel syntax.
e3308d0d
JE
76@end table
77
78@node Directives-i860
79@section i860 Machine Directives
80
81@cindex machine directives, i860
82@cindex i860 machine directives
83
84@table @code
85@cindex @code{dual} directive, i860
86@item .dual
87Enter dual instruction mode. While this directive is supported, the
88preferred way to use dual instruction mode is to explicitly code
89the dual bit with the @code{d.} prefix.
90@end table
91
92@table @code
93@cindex @code{enddual} directive, i860
94@item .enddual
95Exit dual instruction mode. While this directive is supported, the
96preferred way to use dual instruction mode is to explicitly code
97the dual bit with the @code{d.} prefix.
98@end table
99
100@table @code
101@cindex @code{atmp} directive, i860
102@item .atmp
103Change the temporary register used when expanding pseudo operations. The
104default register is @code{r31}.
105@end table
106
5eb0723a
JE
107The @code{.dual}, @code{.enddual}, and @code{.atmp} directives are available only in the Intel syntax mode.
108
e3308d0d
JE
109@node Opcodes for i860
110@section i860 Opcodes
111
112@cindex opcodes, i860
113@cindex i860 opcodes
14218d5f 114All of the Intel i860XR and i860XP machine instructions are supported. Please see
a9c99419
JE
115either @emph{i860 Microprocessor Programmer's Reference Manual} or @emph{i860 Microprocessor Architecture} for more information.
116@subsection Other instruction support (pseudo-instructions)
117For compatibility with some other i860 assemblers, a number of
118pseudo-instructions are supported. While these are supported, they are
119a very undesirable feature that should be avoided -- in particular, when
120they result in an expansion to multiple actual i860 instructions. Below
121are the pseudo-instructions that result in expansions.
122@itemize @bullet
9fc2dda2 123@item Load large immediate into general register:
a9c99419
JE
124
125The pseudo-instruction @code{mov imm,%rn} (where the immediate does
126not fit within a signed 16-bit field) will be expanded into:
127@smallexample
128orh large_imm@@h,%r0,%rn
129or large_imm@@l,%rn,%rn
130@end smallexample
9fc2dda2 131@item Load/store with relocatable address expression:
a9c99419
JE
132
133For example, the pseudo-instruction @code{ld.b addr,%rn}
134will be expanded into:
135@smallexample
136orh addr_exp@@ha,%r0,%r31
137ld.l addr_exp@@l(%r31),%rn
138@end smallexample
139
140The analogous expansions apply to @code{ld.x, st.x, fld.x, pfld.x, fst.x}, and @code{pst.x} as well.
9fc2dda2
JE
141@item Signed large immediate with add/subtract:
142
a9c99419
JE
143If any of the arithmetic operations @code{adds, addu, subs, subu} are used
144with an immediate larger than 16-bits (signed), then they will be expanded.
145For instance, the pseudo-instruction @code{adds large_imm,%rx,%rn} expands to:
146@smallexample
147orh large_imm@@h,%r0,%r31
148or large_imm@@l,%r31,%r31
149adds %r31,%rx,%rn
150@end smallexample
9fc2dda2
JE
151@item Unsigned large immediate with logical operations:
152
a9c99419
JE
153Logical operations (@code{or, andnot, or, xor}) also result in expansions.
154The pseudo-instruction @code{or large_imm,%rx,%rn} results in:
155@smallexample
156orh large_imm@@h,%rx,%r31
157or large_imm@@l,%r31,%rn
158@end smallexample
e3308d0d 159
a9c99419
JE
160Similarly for the others, except for @code{and} which expands to:
161@smallexample
162andnot (-1 - large_imm)@@h,%rx,%r31
163andnot (-1 - large_imm)@@l,%r31,%rn
164@end smallexample
165@end itemize
e3308d0d 166
This page took 0.144709 seconds and 4 git commands to generate.