c-i860.texi 6.8 KB

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