1 | This is as.info, produced by makeinfo version 4.3 from as.texinfo.
|
---|
2 |
|
---|
3 | START-INFO-DIR-ENTRY
|
---|
4 | * As: (as). The GNU assembler.
|
---|
5 | * Gas: (as). The GNU assembler.
|
---|
6 | END-INFO-DIR-ENTRY
|
---|
7 |
|
---|
8 | This file documents the GNU Assembler "as".
|
---|
9 |
|
---|
10 | Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002
|
---|
11 | Free Software Foundation, Inc.
|
---|
12 |
|
---|
13 | Permission is granted to copy, distribute and/or modify this document
|
---|
14 | under the terms of the GNU Free Documentation License, Version 1.1 or
|
---|
15 | any later version published by the Free Software Foundation; with no
|
---|
16 | Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
|
---|
17 | Texts. A copy of the license is included in the section entitled "GNU
|
---|
18 | Free Documentation License".
|
---|
19 |
|
---|
20 |
|
---|
21 | File: as.info, Node: callj-i960, Next: Compare-and-branch-i960, Up: Opcodes for i960
|
---|
22 |
|
---|
23 | `callj'
|
---|
24 | .......
|
---|
25 |
|
---|
26 | You can write `callj' to have the assembler or the linker determine
|
---|
27 | the most appropriate form of subroutine call: `call', `bal', or
|
---|
28 | `calls'. If the assembly source contains enough information--a
|
---|
29 | `.leafproc' or `.sysproc' directive defining the operand--then `as'
|
---|
30 | translates the `callj'; if not, it simply emits the `callj', leaving it
|
---|
31 | for the linker to resolve.
|
---|
32 |
|
---|
33 |
|
---|
34 | File: as.info, Node: Compare-and-branch-i960, Prev: callj-i960, Up: Opcodes for i960
|
---|
35 |
|
---|
36 | Compare-and-Branch
|
---|
37 | ..................
|
---|
38 |
|
---|
39 | The 960 architectures provide combined Compare-and-Branch
|
---|
40 | instructions that permit you to store the branch target in the lower 13
|
---|
41 | bits of the instruction word itself. However, if you specify a branch
|
---|
42 | target far enough away that its address won't fit in 13 bits, the
|
---|
43 | assembler can either issue an error, or convert your Compare-and-Branch
|
---|
44 | instruction into separate instructions to do the compare and the branch.
|
---|
45 |
|
---|
46 | Whether `as' gives an error or expands the instruction depends on
|
---|
47 | two choices you can make: whether you use the `-no-relax' option, and
|
---|
48 | whether you use a "Compare and Branch" instruction or a "Compare and
|
---|
49 | Jump" instruction. The "Jump" instructions are _always_ expanded if
|
---|
50 | necessary; the "Branch" instructions are expanded when necessary
|
---|
51 | _unless_ you specify `-no-relax'--in which case `as' gives an error
|
---|
52 | instead.
|
---|
53 |
|
---|
54 | These are the Compare-and-Branch instructions, their "Jump" variants,
|
---|
55 | and the instruction pairs they may expand into:
|
---|
56 |
|
---|
57 | Compare and
|
---|
58 | Branch Jump Expanded to
|
---|
59 | ------ ------ ------------
|
---|
60 | bbc chkbit; bno
|
---|
61 | bbs chkbit; bo
|
---|
62 | cmpibe cmpije cmpi; be
|
---|
63 | cmpibg cmpijg cmpi; bg
|
---|
64 | cmpibge cmpijge cmpi; bge
|
---|
65 | cmpibl cmpijl cmpi; bl
|
---|
66 | cmpible cmpijle cmpi; ble
|
---|
67 | cmpibno cmpijno cmpi; bno
|
---|
68 | cmpibne cmpijne cmpi; bne
|
---|
69 | cmpibo cmpijo cmpi; bo
|
---|
70 | cmpobe cmpoje cmpo; be
|
---|
71 | cmpobg cmpojg cmpo; bg
|
---|
72 | cmpobge cmpojge cmpo; bge
|
---|
73 | cmpobl cmpojl cmpo; bl
|
---|
74 | cmpoble cmpojle cmpo; ble
|
---|
75 | cmpobne cmpojne cmpo; bne
|
---|
76 |
|
---|
77 |
|
---|
78 | File: as.info, Node: IP2K-Dependent, Next: M32R-Dependent, Prev: i960-Dependent, Up: Machine Dependencies
|
---|
79 |
|
---|
80 | IP2K Dependent Features
|
---|
81 | =======================
|
---|
82 |
|
---|
83 | * Menu:
|
---|
84 |
|
---|
85 | * IP2K-Opts:: IP2K Options
|
---|
86 |
|
---|
87 |
|
---|
88 | File: as.info, Node: IP2K-Opts, Up: IP2K-Dependent
|
---|
89 |
|
---|
90 | IP2K Options
|
---|
91 | ------------
|
---|
92 |
|
---|
93 | The Ubicom IP2K version of `as' has a few machine dependent options:
|
---|
94 |
|
---|
95 | `-mip2022ext'
|
---|
96 | `as' can assemble the extended IP2022 instructions, but it will
|
---|
97 | only do so if this is specifically allowed via this command line
|
---|
98 | option.
|
---|
99 |
|
---|
100 | `-mip2022'
|
---|
101 | This option restores the assembler's default behaviour of not
|
---|
102 | permitting the extended IP2022 instructions to be assembled.
|
---|
103 |
|
---|
104 |
|
---|
105 | File: as.info, Node: M32R-Dependent, Next: M68K-Dependent, Prev: IP2K-Dependent, Up: Machine Dependencies
|
---|
106 |
|
---|
107 | M32R Dependent Features
|
---|
108 | =======================
|
---|
109 |
|
---|
110 | * Menu:
|
---|
111 |
|
---|
112 | * M32R-Opts:: M32R Options
|
---|
113 | * M32R-Warnings:: M32R Warnings
|
---|
114 |
|
---|
115 |
|
---|
116 | File: as.info, Node: M32R-Opts, Next: M32R-Warnings, Up: M32R-Dependent
|
---|
117 |
|
---|
118 | M32R Options
|
---|
119 | ------------
|
---|
120 |
|
---|
121 | The Renease M32R version of `as' has a few machine dependent options:
|
---|
122 |
|
---|
123 | `-m32rx'
|
---|
124 | `as' can assemble code for several different members of the
|
---|
125 | Renesas M32R family. Normally the default is to assemble code for
|
---|
126 | the M32R microprocessor. This option may be used to change the
|
---|
127 | default to the M32RX microprocessor, which adds some more
|
---|
128 | instructions to the basic M32R instruction set, and some
|
---|
129 | additional parameters to some of the original instructions.
|
---|
130 |
|
---|
131 | `-m32r'
|
---|
132 | This option can be used to restore the assembler's default
|
---|
133 | behaviour of assembling for the M32R microprocessor. This can be
|
---|
134 | useful if the default has been changed by a previous command line
|
---|
135 | option.
|
---|
136 |
|
---|
137 | `-warn-explicit-parallel-conflicts'
|
---|
138 | Instructs `as' to produce warning messages when questionable
|
---|
139 | parallel instructions are encountered. This option is enabled by
|
---|
140 | default, but `gcc' disables it when it invokes `as' directly.
|
---|
141 | Questionable instructions are those whoes behaviour would be
|
---|
142 | different if they were executed sequentially. For example the
|
---|
143 | code fragment `mv r1, r2 || mv r3, r1' produces a different result
|
---|
144 | from `mv r1, r2 \n mv r3, r1' since the former moves r1 into r3
|
---|
145 | and then r2 into r1, whereas the later moves r2 into r1 and r3.
|
---|
146 |
|
---|
147 | `-Wp'
|
---|
148 | This is a shorter synonym for the
|
---|
149 | _-warn-explicit-parallel-conflicts_ option.
|
---|
150 |
|
---|
151 | `-no-warn-explicit-parallel-conflicts'
|
---|
152 | Instructs `as' not to produce warning messages when questionable
|
---|
153 | parallel instructions are encountered.
|
---|
154 |
|
---|
155 | `-Wnp'
|
---|
156 | This is a shorter synonym for the
|
---|
157 | _-no-warn-explicit-parallel-conflicts_ option.
|
---|
158 |
|
---|
159 |
|
---|
160 | File: as.info, Node: M32R-Warnings, Prev: M32R-Opts, Up: M32R-Dependent
|
---|
161 |
|
---|
162 | M32R Warnings
|
---|
163 | -------------
|
---|
164 |
|
---|
165 | There are several warning and error messages that can be produced by
|
---|
166 | `as' which are specific to the M32R:
|
---|
167 |
|
---|
168 | `output of 1st instruction is the same as an input to 2nd instruction - is this intentional ?'
|
---|
169 | This message is only produced if warnings for explicit parallel
|
---|
170 | conflicts have been enabled. It indicates that the assembler has
|
---|
171 | encountered a parallel instruction in which the destination
|
---|
172 | register of the left hand instruction is used as an input register
|
---|
173 | in the right hand instruction. For example in this code fragment
|
---|
174 | `mv r1, r2 || neg r3, r1' register r1 is the destination of the
|
---|
175 | move instruction and the input to the neg instruction.
|
---|
176 |
|
---|
177 | `output of 2nd instruction is the same as an input to 1st instruction - is this intentional ?'
|
---|
178 | This message is only produced if warnings for explicit parallel
|
---|
179 | conflicts have been enabled. It indicates that the assembler has
|
---|
180 | encountered a parallel instruction in which the destination
|
---|
181 | register of the right hand instruction is used as an input
|
---|
182 | register in the left hand instruction. For example in this code
|
---|
183 | fragment `mv r1, r2 || neg r2, r3' register r2 is the destination
|
---|
184 | of the neg instruction and the input to the move instruction.
|
---|
185 |
|
---|
186 | `instruction `...' is for the M32RX only'
|
---|
187 | This message is produced when the assembler encounters an
|
---|
188 | instruction which is only supported by the M32Rx processor, and
|
---|
189 | the `-m32rx' command line flag has not been specified to allow
|
---|
190 | assembly of such instructions.
|
---|
191 |
|
---|
192 | `unknown instruction `...''
|
---|
193 | This message is produced when the assembler encounters an
|
---|
194 | instruction which it doe snot recognise.
|
---|
195 |
|
---|
196 | `only the NOP instruction can be issued in parallel on the m32r'
|
---|
197 | This message is produced when the assembler encounters a parallel
|
---|
198 | instruction which does not involve a NOP instruction and the
|
---|
199 | `-m32rx' command line flag has not been specified. Only the M32Rx
|
---|
200 | processor is able to execute two instructions in parallel.
|
---|
201 |
|
---|
202 | `instruction `...' cannot be executed in parallel.'
|
---|
203 | This message is produced when the assembler encounters a parallel
|
---|
204 | instruction which is made up of one or two instructions which
|
---|
205 | cannot be executed in parallel.
|
---|
206 |
|
---|
207 | `Instructions share the same execution pipeline'
|
---|
208 | This message is produced when the assembler encounters a parallel
|
---|
209 | instruction whoes components both use the same execution pipeline.
|
---|
210 |
|
---|
211 | `Instructions write to the same destination register.'
|
---|
212 | This message is produced when the assembler encounters a parallel
|
---|
213 | instruction where both components attempt to modify the same
|
---|
214 | register. For example these code fragments will produce this
|
---|
215 | message: `mv r1, r2 || neg r1, r3' `jl r0 || mv r14, r1' `st r2,
|
---|
216 | @-r1 || mv r1, r3' `mv r1, r2 || ld r0, @r1+' `cmp r1, r2 || addx
|
---|
217 | r3, r4' (Both write to the condition bit)
|
---|
218 |
|
---|
219 |
|
---|
220 | File: as.info, Node: M68K-Dependent, Next: M68HC11-Dependent, Prev: M32R-Dependent, Up: Machine Dependencies
|
---|
221 |
|
---|
222 | M680x0 Dependent Features
|
---|
223 | =========================
|
---|
224 |
|
---|
225 | * Menu:
|
---|
226 |
|
---|
227 | * M68K-Opts:: M680x0 Options
|
---|
228 | * M68K-Syntax:: Syntax
|
---|
229 | * M68K-Moto-Syntax:: Motorola Syntax
|
---|
230 | * M68K-Float:: Floating Point
|
---|
231 | * M68K-Directives:: 680x0 Machine Directives
|
---|
232 | * M68K-opcodes:: Opcodes
|
---|
233 |
|
---|
234 |
|
---|
235 | File: as.info, Node: M68K-Opts, Next: M68K-Syntax, Up: M68K-Dependent
|
---|
236 |
|
---|
237 | M680x0 Options
|
---|
238 | --------------
|
---|
239 |
|
---|
240 | The Motorola 680x0 version of `as' has a few machine dependent
|
---|
241 | options:
|
---|
242 |
|
---|
243 | `-l'
|
---|
244 | You can use the `-l' option to shorten the size of references to
|
---|
245 | undefined symbols. If you do not use the `-l' option, references
|
---|
246 | to undefined symbols are wide enough for a full `long' (32 bits).
|
---|
247 | (Since `as' cannot know where these symbols end up, `as' can only
|
---|
248 | allocate space for the linker to fill in later. Since `as' does
|
---|
249 | not know how far away these symbols are, it allocates as much
|
---|
250 | space as it can.) If you use this option, the references are only
|
---|
251 | one word wide (16 bits). This may be useful if you want the
|
---|
252 | object file to be as small as possible, and you know that the
|
---|
253 | relevant symbols are always less than 17 bits away.
|
---|
254 |
|
---|
255 | `--register-prefix-optional'
|
---|
256 | For some configurations, especially those where the compiler
|
---|
257 | normally does not prepend an underscore to the names of user
|
---|
258 | variables, the assembler requires a `%' before any use of a
|
---|
259 | register name. This is intended to let the assembler distinguish
|
---|
260 | between C variables and functions named `a0' through `a7', and so
|
---|
261 | on. The `%' is always accepted, but is not required for certain
|
---|
262 | configurations, notably `sun3'. The `--register-prefix-optional'
|
---|
263 | option may be used to permit omitting the `%' even for
|
---|
264 | configurations for which it is normally required. If this is
|
---|
265 | done, it will generally be impossible to refer to C variables and
|
---|
266 | functions with the same names as register names.
|
---|
267 |
|
---|
268 | `--bitwise-or'
|
---|
269 | Normally the character `|' is treated as a comment character, which
|
---|
270 | means that it can not be used in expressions. The `--bitwise-or'
|
---|
271 | option turns `|' into a normal character. In this mode, you must
|
---|
272 | either use C style comments, or start comments with a `#' character
|
---|
273 | at the beginning of a line.
|
---|
274 |
|
---|
275 | `--base-size-default-16 --base-size-default-32'
|
---|
276 | If you use an addressing mode with a base register without
|
---|
277 | specifying the size, `as' will normally use the full 32 bit value.
|
---|
278 | For example, the addressing mode `%a0@(%d0)' is equivalent to
|
---|
279 | `%a0@(%d0:l)'. You may use the `--base-size-default-16' option to
|
---|
280 | tell `as' to default to using the 16 bit value. In this case,
|
---|
281 | `%a0@(%d0)' is equivalent to `%a0@(%d0:w)'. You may use the
|
---|
282 | `--base-size-default-32' option to restore the default behaviour.
|
---|
283 |
|
---|
284 | `--disp-size-default-16 --disp-size-default-32'
|
---|
285 | If you use an addressing mode with a displacement, and the value
|
---|
286 | of the displacement is not known, `as' will normally assume that
|
---|
287 | the value is 32 bits. For example, if the symbol `disp' has not
|
---|
288 | been defined, `as' will assemble the addressing mode
|
---|
289 | `%a0@(disp,%d0)' as though `disp' is a 32 bit value. You may use
|
---|
290 | the `--disp-size-default-16' option to tell `as' to instead assume
|
---|
291 | that the displacement is 16 bits. In this case, `as' will
|
---|
292 | assemble `%a0@(disp,%d0)' as though `disp' is a 16 bit value. You
|
---|
293 | may use the `--disp-size-default-32' option to restore the default
|
---|
294 | behaviour.
|
---|
295 |
|
---|
296 | `--pcrel'
|
---|
297 | Always keep branches PC-relative. In the M680x0 architecture all
|
---|
298 | branches are defined as PC-relative. However, on some processors
|
---|
299 | they are limited to word displacements maximum. When `as' needs a
|
---|
300 | long branch that is not available, it normally emits an absolute
|
---|
301 | jump instead. This option disables this substitution. When this
|
---|
302 | option is given and no long branches are available, only word
|
---|
303 | branches will be emitted. An error message will be generated if a
|
---|
304 | word branch cannot reach its target. This option has no effect on
|
---|
305 | 68020 and other processors that have long branches. *note Branch
|
---|
306 | Improvement: M68K-Branch..
|
---|
307 |
|
---|
308 | `-m68000'
|
---|
309 | `as' can assemble code for several different members of the
|
---|
310 | Motorola 680x0 family. The default depends upon how `as' was
|
---|
311 | configured when it was built; normally, the default is to assemble
|
---|
312 | code for the 68020 microprocessor. The following options may be
|
---|
313 | used to change the default. These options control which
|
---|
314 | instructions and addressing modes are permitted. The members of
|
---|
315 | the 680x0 family are very similar. For detailed information about
|
---|
316 | the differences, see the Motorola manuals.
|
---|
317 |
|
---|
318 | `-m68000'
|
---|
319 | `-m68ec000'
|
---|
320 | `-m68hc000'
|
---|
321 | `-m68hc001'
|
---|
322 | `-m68008'
|
---|
323 | `-m68302'
|
---|
324 | `-m68306'
|
---|
325 | `-m68307'
|
---|
326 | `-m68322'
|
---|
327 | `-m68356'
|
---|
328 | Assemble for the 68000. `-m68008', `-m68302', and so on are
|
---|
329 | synonyms for `-m68000', since the chips are the same from the
|
---|
330 | point of view of the assembler.
|
---|
331 |
|
---|
332 | `-m68010'
|
---|
333 | Assemble for the 68010.
|
---|
334 |
|
---|
335 | `-m68020'
|
---|
336 | `-m68ec020'
|
---|
337 | Assemble for the 68020. This is normally the default.
|
---|
338 |
|
---|
339 | `-m68030'
|
---|
340 | `-m68ec030'
|
---|
341 | Assemble for the 68030.
|
---|
342 |
|
---|
343 | `-m68040'
|
---|
344 | `-m68ec040'
|
---|
345 | Assemble for the 68040.
|
---|
346 |
|
---|
347 | `-m68060'
|
---|
348 | `-m68ec060'
|
---|
349 | Assemble for the 68060.
|
---|
350 |
|
---|
351 | `-mcpu32'
|
---|
352 | `-m68330'
|
---|
353 | `-m68331'
|
---|
354 | `-m68332'
|
---|
355 | `-m68333'
|
---|
356 | `-m68334'
|
---|
357 | `-m68336'
|
---|
358 | `-m68340'
|
---|
359 | `-m68341'
|
---|
360 | `-m68349'
|
---|
361 | `-m68360'
|
---|
362 | Assemble for the CPU32 family of chips.
|
---|
363 |
|
---|
364 | `-m5200'
|
---|
365 | Assemble for the ColdFire family of chips.
|
---|
366 |
|
---|
367 | `-m68881'
|
---|
368 | `-m68882'
|
---|
369 | Assemble 68881 floating point instructions. This is the
|
---|
370 | default for the 68020, 68030, and the CPU32. The 68040 and
|
---|
371 | 68060 always support floating point instructions.
|
---|
372 |
|
---|
373 | `-mno-68881'
|
---|
374 | Do not assemble 68881 floating point instructions. This is
|
---|
375 | the default for 68000 and the 68010. The 68040 and 68060
|
---|
376 | always support floating point instructions, even if this
|
---|
377 | option is used.
|
---|
378 |
|
---|
379 | `-m68851'
|
---|
380 | Assemble 68851 MMU instructions. This is the default for the
|
---|
381 | 68020, 68030, and 68060. The 68040 accepts a somewhat
|
---|
382 | different set of MMU instructions; `-m68851' and `-m68040'
|
---|
383 | should not be used together.
|
---|
384 |
|
---|
385 | `-mno-68851'
|
---|
386 | Do not assemble 68851 MMU instructions. This is the default
|
---|
387 | for the 68000, 68010, and the CPU32. The 68040 accepts a
|
---|
388 | somewhat different set of MMU instructions.
|
---|
389 |
|
---|
390 |
|
---|
391 | File: as.info, Node: M68K-Syntax, Next: M68K-Moto-Syntax, Prev: M68K-Opts, Up: M68K-Dependent
|
---|
392 |
|
---|
393 | Syntax
|
---|
394 | ------
|
---|
395 |
|
---|
396 | This syntax for the Motorola 680x0 was developed at MIT.
|
---|
397 |
|
---|
398 | The 680x0 version of `as' uses instructions names and syntax
|
---|
399 | compatible with the Sun assembler. Intervening periods are ignored;
|
---|
400 | for example, `movl' is equivalent to `mov.l'.
|
---|
401 |
|
---|
402 | In the following table APC stands for any of the address registers
|
---|
403 | (`%a0' through `%a7'), the program counter (`%pc'), the zero-address
|
---|
404 | relative to the program counter (`%zpc'), a suppressed address register
|
---|
405 | (`%za0' through `%za7'), or it may be omitted entirely. The use of
|
---|
406 | SIZE means one of `w' or `l', and it may be omitted, along with the
|
---|
407 | leading colon, unless a scale is also specified. The use of SCALE
|
---|
408 | means one of `1', `2', `4', or `8', and it may always be omitted along
|
---|
409 | with the leading colon.
|
---|
410 |
|
---|
411 | The following addressing modes are understood:
|
---|
412 | "Immediate"
|
---|
413 | `#NUMBER'
|
---|
414 |
|
---|
415 | "Data Register"
|
---|
416 | `%d0' through `%d7'
|
---|
417 |
|
---|
418 | "Address Register"
|
---|
419 | `%a0' through `%a7'
|
---|
420 | `%a7' is also known as `%sp', i.e. the Stack Pointer. `%a6' is
|
---|
421 | also known as `%fp', the Frame Pointer.
|
---|
422 |
|
---|
423 | "Address Register Indirect"
|
---|
424 | `%a0@' through `%a7@'
|
---|
425 |
|
---|
426 | "Address Register Postincrement"
|
---|
427 | `%a0@+' through `%a7@+'
|
---|
428 |
|
---|
429 | "Address Register Predecrement"
|
---|
430 | `%a0@-' through `%a7@-'
|
---|
431 |
|
---|
432 | "Indirect Plus Offset"
|
---|
433 | `APC@(NUMBER)'
|
---|
434 |
|
---|
435 | "Index"
|
---|
436 | `APC@(NUMBER,REGISTER:SIZE:SCALE)'
|
---|
437 |
|
---|
438 | The NUMBER may be omitted.
|
---|
439 |
|
---|
440 | "Postindex"
|
---|
441 | `APC@(NUMBER)@(ONUMBER,REGISTER:SIZE:SCALE)'
|
---|
442 |
|
---|
443 | The ONUMBER or the REGISTER, but not both, may be omitted.
|
---|
444 |
|
---|
445 | "Preindex"
|
---|
446 | `APC@(NUMBER,REGISTER:SIZE:SCALE)@(ONUMBER)'
|
---|
447 |
|
---|
448 | The NUMBER may be omitted. Omitting the REGISTER produces the
|
---|
449 | Postindex addressing mode.
|
---|
450 |
|
---|
451 | "Absolute"
|
---|
452 | `SYMBOL', or `DIGITS', optionally followed by `:b', `:w', or `:l'.
|
---|
453 |
|
---|
454 |
|
---|
455 | File: as.info, Node: M68K-Moto-Syntax, Next: M68K-Float, Prev: M68K-Syntax, Up: M68K-Dependent
|
---|
456 |
|
---|
457 | Motorola Syntax
|
---|
458 | ---------------
|
---|
459 |
|
---|
460 | The standard Motorola syntax for this chip differs from the syntax
|
---|
461 | already discussed (*note Syntax: M68K-Syntax.). `as' can accept
|
---|
462 | Motorola syntax for operands, even if MIT syntax is used for other
|
---|
463 | operands in the same instruction. The two kinds of syntax are fully
|
---|
464 | compatible.
|
---|
465 |
|
---|
466 | In the following table APC stands for any of the address registers
|
---|
467 | (`%a0' through `%a7'), the program counter (`%pc'), the zero-address
|
---|
468 | relative to the program counter (`%zpc'), or a suppressed address
|
---|
469 | register (`%za0' through `%za7'). The use of SIZE means one of `w' or
|
---|
470 | `l', and it may always be omitted along with the leading dot. The use
|
---|
471 | of SCALE means one of `1', `2', `4', or `8', and it may always be
|
---|
472 | omitted along with the leading asterisk.
|
---|
473 |
|
---|
474 | The following additional addressing modes are understood:
|
---|
475 |
|
---|
476 | "Address Register Indirect"
|
---|
477 | `(%a0)' through `(%a7)'
|
---|
478 | `%a7' is also known as `%sp', i.e. the Stack Pointer. `%a6' is
|
---|
479 | also known as `%fp', the Frame Pointer.
|
---|
480 |
|
---|
481 | "Address Register Postincrement"
|
---|
482 | `(%a0)+' through `(%a7)+'
|
---|
483 |
|
---|
484 | "Address Register Predecrement"
|
---|
485 | `-(%a0)' through `-(%a7)'
|
---|
486 |
|
---|
487 | "Indirect Plus Offset"
|
---|
488 | `NUMBER(%A0)' through `NUMBER(%A7)', or `NUMBER(%PC)'.
|
---|
489 |
|
---|
490 | The NUMBER may also appear within the parentheses, as in
|
---|
491 | `(NUMBER,%A0)'. When used with the PC, the NUMBER may be omitted
|
---|
492 | (with an address register, omitting the NUMBER produces Address
|
---|
493 | Register Indirect mode).
|
---|
494 |
|
---|
495 | "Index"
|
---|
496 | `NUMBER(APC,REGISTER.SIZE*SCALE)'
|
---|
497 |
|
---|
498 | The NUMBER may be omitted, or it may appear within the
|
---|
499 | parentheses. The APC may be omitted. The REGISTER and the APC
|
---|
500 | may appear in either order. If both APC and REGISTER are address
|
---|
501 | registers, and the SIZE and SCALE are omitted, then the first
|
---|
502 | register is taken as the base register, and the second as the
|
---|
503 | index register.
|
---|
504 |
|
---|
505 | "Postindex"
|
---|
506 | `([NUMBER,APC],REGISTER.SIZE*SCALE,ONUMBER)'
|
---|
507 |
|
---|
508 | The ONUMBER, or the REGISTER, or both, may be omitted. Either the
|
---|
509 | NUMBER or the APC may be omitted, but not both.
|
---|
510 |
|
---|
511 | "Preindex"
|
---|
512 | `([NUMBER,APC,REGISTER.SIZE*SCALE],ONUMBER)'
|
---|
513 |
|
---|
514 | The NUMBER, or the APC, or the REGISTER, or any two of them, may
|
---|
515 | be omitted. The ONUMBER may be omitted. The REGISTER and the APC
|
---|
516 | may appear in either order. If both APC and REGISTER are address
|
---|
517 | registers, and the SIZE and SCALE are omitted, then the first
|
---|
518 | register is taken as the base register, and the second as the
|
---|
519 | index register.
|
---|
520 |
|
---|
521 |
|
---|
522 | File: as.info, Node: M68K-Float, Next: M68K-Directives, Prev: M68K-Moto-Syntax, Up: M68K-Dependent
|
---|
523 |
|
---|
524 | Floating Point
|
---|
525 | --------------
|
---|
526 |
|
---|
527 | Packed decimal (P) format floating literals are not supported. Feel
|
---|
528 | free to add the code!
|
---|
529 |
|
---|
530 | The floating point formats generated by directives are these.
|
---|
531 |
|
---|
532 | `.float'
|
---|
533 | `Single' precision floating point constants.
|
---|
534 |
|
---|
535 | `.double'
|
---|
536 | `Double' precision floating point constants.
|
---|
537 |
|
---|
538 | `.extend'
|
---|
539 | `.ldouble'
|
---|
540 | `Extended' precision (`long double') floating point constants.
|
---|
541 |
|
---|
542 |
|
---|
543 | File: as.info, Node: M68K-Directives, Next: M68K-opcodes, Prev: M68K-Float, Up: M68K-Dependent
|
---|
544 |
|
---|
545 | 680x0 Machine Directives
|
---|
546 | ------------------------
|
---|
547 |
|
---|
548 | In order to be compatible with the Sun assembler the 680x0 assembler
|
---|
549 | understands the following directives.
|
---|
550 |
|
---|
551 | `.data1'
|
---|
552 | This directive is identical to a `.data 1' directive.
|
---|
553 |
|
---|
554 | `.data2'
|
---|
555 | This directive is identical to a `.data 2' directive.
|
---|
556 |
|
---|
557 | `.even'
|
---|
558 | This directive is a special case of the `.align' directive; it
|
---|
559 | aligns the output to an even byte boundary.
|
---|
560 |
|
---|
561 | `.skip'
|
---|
562 | This directive is identical to a `.space' directive.
|
---|
563 |
|
---|
564 |
|
---|
565 | File: as.info, Node: M68K-opcodes, Prev: M68K-Directives, Up: M68K-Dependent
|
---|
566 |
|
---|
567 | Opcodes
|
---|
568 | -------
|
---|
569 |
|
---|
570 | * Menu:
|
---|
571 |
|
---|
572 | * M68K-Branch:: Branch Improvement
|
---|
573 | * M68K-Chars:: Special Characters
|
---|
574 |
|
---|
575 |
|
---|
576 | File: as.info, Node: M68K-Branch, Next: M68K-Chars, Up: M68K-opcodes
|
---|
577 |
|
---|
578 | Branch Improvement
|
---|
579 | ..................
|
---|
580 |
|
---|
581 | Certain pseudo opcodes are permitted for branch instructions. They
|
---|
582 | expand to the shortest branch instruction that reach the target.
|
---|
583 | Generally these mnemonics are made by substituting `j' for `b' at the
|
---|
584 | start of a Motorola mnemonic.
|
---|
585 |
|
---|
586 | The following table summarizes the pseudo-operations. A `*' flags
|
---|
587 | cases that are more fully described after the table:
|
---|
588 |
|
---|
589 | Displacement
|
---|
590 | +------------------------------------------------------------
|
---|
591 | | 68020 68000/10, not PC-relative OK
|
---|
592 | Pseudo-Op |BYTE WORD LONG ABSOLUTE LONG JUMP **
|
---|
593 | +------------------------------------------------------------
|
---|
594 | jbsr |bsrs bsrw bsrl jsr
|
---|
595 | jra |bras braw bral jmp
|
---|
596 | * jXX |bXXs bXXw bXXl bNXs;jmp
|
---|
597 | * dbXX | N/A dbXXw dbXX;bras;bral dbXX;bras;jmp
|
---|
598 | fjXX | N/A fbXXw fbXXl N/A
|
---|
599 |
|
---|
600 | XX: condition
|
---|
601 | NX: negative of condition XX
|
---|
602 | `*'--see full description below
|
---|
603 | `**'--this expansion mode is disallowed by `--pcrel'
|
---|
604 | `jbsr'
|
---|
605 | `jra'
|
---|
606 | These are the simplest jump pseudo-operations; they always map to
|
---|
607 | one particular machine instruction, depending on the displacement
|
---|
608 | to the branch target. This instruction will be a byte or word
|
---|
609 | branch is that is sufficient. Otherwise, a long branch will be
|
---|
610 | emitted if available. If no long branches are available and the
|
---|
611 | `--pcrel' option is not given, an absolute long jump will be
|
---|
612 | emitted instead. If no long branches are available, the `--pcrel'
|
---|
613 | option is given, and a word branch cannot reach the target, an
|
---|
614 | error message is generated.
|
---|
615 |
|
---|
616 | In addition to standard branch operands, `as' allows these
|
---|
617 | pseudo-operations to have all operands that are allowed for jsr
|
---|
618 | and jmp, substituting these instructions if the operand given is
|
---|
619 | not valid for a branch instruction.
|
---|
620 |
|
---|
621 | `jXX'
|
---|
622 | Here, `jXX' stands for an entire family of pseudo-operations,
|
---|
623 | where XX is a conditional branch or condition-code test. The full
|
---|
624 | list of pseudo-ops in this family is:
|
---|
625 | jhi jls jcc jcs jne jeq jvc
|
---|
626 | jvs jpl jmi jge jlt jgt jle
|
---|
627 |
|
---|
628 | Usually, each of these pseudo-operations expands to a single branch
|
---|
629 | instruction. However, if a word branch is not sufficient, no long
|
---|
630 | branches are available, and the `--pcrel' option is not given, `as'
|
---|
631 | issues a longer code fragment in terms of NX, the opposite
|
---|
632 | condition to XX. For example, under these conditions:
|
---|
633 | jXX foo
|
---|
634 | gives
|
---|
635 | bNXs oof
|
---|
636 | jmp foo
|
---|
637 | oof:
|
---|
638 |
|
---|
639 | `dbXX'
|
---|
640 | The full family of pseudo-operations covered here is
|
---|
641 | dbhi dbls dbcc dbcs dbne dbeq dbvc
|
---|
642 | dbvs dbpl dbmi dbge dblt dbgt dble
|
---|
643 | dbf dbra dbt
|
---|
644 |
|
---|
645 | Motorola `dbXX' instructions allow word displacements only. When
|
---|
646 | a word displacement is sufficient, each of these pseudo-operations
|
---|
647 | expands to the corresponding Motorola instruction. When a word
|
---|
648 | displacement is not sufficient and long branches are available,
|
---|
649 | when the source reads `dbXX foo', `as' emits
|
---|
650 | dbXX oo1
|
---|
651 | bras oo2
|
---|
652 | oo1:bral foo
|
---|
653 | oo2:
|
---|
654 |
|
---|
655 | If, however, long branches are not available and the `--pcrel'
|
---|
656 | option is not given, `as' emits
|
---|
657 | dbXX oo1
|
---|
658 | bras oo2
|
---|
659 | oo1:jmp foo
|
---|
660 | oo2:
|
---|
661 |
|
---|
662 | `fjXX'
|
---|
663 | This family includes
|
---|
664 | fjne fjeq fjge fjlt fjgt fjle fjf
|
---|
665 | fjt fjgl fjgle fjnge fjngl fjngle fjngt
|
---|
666 | fjnle fjnlt fjoge fjogl fjogt fjole fjolt
|
---|
667 | fjor fjseq fjsf fjsne fjst fjueq fjuge
|
---|
668 | fjugt fjule fjult fjun
|
---|
669 |
|
---|
670 | Each of these pseudo-operations always expands to a single Motorola
|
---|
671 | coprocessor branch instruction, word or long. All Motorola
|
---|
672 | coprocessor branch instructions allow both word and long
|
---|
673 | displacements.
|
---|
674 |
|
---|
675 |
|
---|
676 | File: as.info, Node: M68K-Chars, Prev: M68K-Branch, Up: M68K-opcodes
|
---|
677 |
|
---|
678 | Special Characters
|
---|
679 | ..................
|
---|
680 |
|
---|
681 | The immediate character is `#' for Sun compatibility. The line-comment
|
---|
682 | character is `|' (unless the `--bitwise-or' option is used). If a `#'
|
---|
683 | appears at the beginning of a line, it is treated as a comment unless
|
---|
684 | it looks like `# line file', in which case it is treated normally.
|
---|
685 |
|
---|
686 |
|
---|
687 | File: as.info, Node: M68HC11-Dependent, Next: M88K-Dependent, Prev: M68K-Dependent, Up: Machine Dependencies
|
---|
688 |
|
---|
689 | M68HC11 and M68HC12 Dependent Features
|
---|
690 | ======================================
|
---|
691 |
|
---|
692 | * Menu:
|
---|
693 |
|
---|
694 | * M68HC11-Opts:: M68HC11 and M68HC12 Options
|
---|
695 | * M68HC11-Syntax:: Syntax
|
---|
696 | * M68HC11-Modifiers:: Symbolic Operand Modifiers
|
---|
697 | * M68HC11-Directives:: Assembler Directives
|
---|
698 | * M68HC11-Float:: Floating Point
|
---|
699 | * M68HC11-opcodes:: Opcodes
|
---|
700 |
|
---|
701 |
|
---|
702 | File: as.info, Node: M68HC11-Opts, Next: M68HC11-Syntax, Up: M68HC11-Dependent
|
---|
703 |
|
---|
704 | M68HC11 and M68HC12 Options
|
---|
705 | ---------------------------
|
---|
706 |
|
---|
707 | The Motorola 68HC11 and 68HC12 version of `as' have a few machine
|
---|
708 | dependent options.
|
---|
709 |
|
---|
710 | `-m68hc11'
|
---|
711 | This option switches the assembler in the M68HC11 mode. In this
|
---|
712 | mode, the assembler only accepts 68HC11 operands and mnemonics. It
|
---|
713 | produces code for the 68HC11.
|
---|
714 |
|
---|
715 | `-m68hc12'
|
---|
716 | This option switches the assembler in the M68HC12 mode. In this
|
---|
717 | mode, the assembler also accepts 68HC12 operands and mnemonics. It
|
---|
718 | produces code for the 68HC12. A few 68HC11 instructions are
|
---|
719 | replaced by some 68HC12 instructions as recommended by Motorola
|
---|
720 | specifications.
|
---|
721 |
|
---|
722 | `-m68hcs12'
|
---|
723 | This option switches the assembler in the M68HCS12 mode. This
|
---|
724 | mode is similar to `-m68hc12' but specifies to assemble for the
|
---|
725 | 68HCS12 series. The only difference is on the assembling of the
|
---|
726 | `movb' and `movw' instruction when a PC-relative operand is used.
|
---|
727 |
|
---|
728 | `-mshort'
|
---|
729 | This option controls the ABI and indicates to use a 16-bit integer
|
---|
730 | ABI. It has no effect on the assembled instructions. This is the
|
---|
731 | default.
|
---|
732 |
|
---|
733 | `-mlong'
|
---|
734 | This option controls the ABI and indicates to use a 32-bit integer
|
---|
735 | ABI.
|
---|
736 |
|
---|
737 | `-mshort-double'
|
---|
738 | This option controls the ABI and indicates to use a 32-bit float
|
---|
739 | ABI. This is the default.
|
---|
740 |
|
---|
741 | `-mlong-double'
|
---|
742 | This option controls the ABI and indicates to use a 64-bit float
|
---|
743 | ABI.
|
---|
744 |
|
---|
745 | `--strict-direct-mode'
|
---|
746 | You can use the `--strict-direct-mode' option to disable the
|
---|
747 | automatic translation of direct page mode addressing into extended
|
---|
748 | mode when the instruction does not support direct mode. For
|
---|
749 | example, the `clr' instruction does not support direct page mode
|
---|
750 | addressing. When it is used with the direct page mode, `as' will
|
---|
751 | ignore it and generate an absolute addressing. This option
|
---|
752 | prevents `as' from doing this, and the wrong usage of the direct
|
---|
753 | page mode will raise an error.
|
---|
754 |
|
---|
755 | `--short-branchs'
|
---|
756 | The `--short-branchs' option turns off the translation of relative
|
---|
757 | branches into absolute branches when the branch offset is out of
|
---|
758 | range. By default `as' transforms the relative branch (`bsr',
|
---|
759 | `bgt', `bge', `beq', `bne', `ble', `blt', `bhi', `bcc', `bls',
|
---|
760 | `bcs', `bmi', `bvs', `bvs', `bra') into an absolute branch when
|
---|
761 | the offset is out of the -128 .. 127 range. In that case, the
|
---|
762 | `bsr' instruction is translated into a `jsr', the `bra'
|
---|
763 | instruction is translated into a `jmp' and the conditional branchs
|
---|
764 | instructions are inverted and followed by a `jmp'. This option
|
---|
765 | disables these translations and `as' will generate an error if a
|
---|
766 | relative branch is out of range. This option does not affect the
|
---|
767 | optimization associated to the `jbra', `jbsr' and `jbXX' pseudo
|
---|
768 | opcodes.
|
---|
769 |
|
---|
770 | `--force-long-branchs'
|
---|
771 | The `--force-long-branchs' option forces the translation of
|
---|
772 | relative branches into absolute branches. This option does not
|
---|
773 | affect the optimization associated to the `jbra', `jbsr' and
|
---|
774 | `jbXX' pseudo opcodes.
|
---|
775 |
|
---|
776 | `--print-insn-syntax'
|
---|
777 | You can use the `--print-insn-syntax' option to obtain the syntax
|
---|
778 | description of the instruction when an error is detected.
|
---|
779 |
|
---|
780 | `--print-opcodes'
|
---|
781 | The `--print-opcodes' option prints the list of all the
|
---|
782 | instructions with their syntax. The first item of each line
|
---|
783 | represents the instruction name and the rest of the line indicates
|
---|
784 | the possible operands for that instruction. The list is printed in
|
---|
785 | alphabetical order. Once the list is printed `as' exits.
|
---|
786 |
|
---|
787 | `--generate-example'
|
---|
788 | The `--generate-example' option is similar to `--print-opcodes'
|
---|
789 | but it generates an example for each instruction instead.
|
---|
790 |
|
---|
791 |
|
---|
792 | File: as.info, Node: M68HC11-Syntax, Next: M68HC11-Modifiers, Prev: M68HC11-Opts, Up: M68HC11-Dependent
|
---|
793 |
|
---|
794 | Syntax
|
---|
795 | ------
|
---|
796 |
|
---|
797 | In the M68HC11 syntax, the instruction name comes first and it may
|
---|
798 | be followed by one or several operands (up to three). Operands are
|
---|
799 | separated by comma (`,'). In the normal mode, `as' will complain if too
|
---|
800 | many operands are specified for a given instruction. In the MRI mode
|
---|
801 | (turned on with `-M' option), it will treat them as comments. Example:
|
---|
802 |
|
---|
803 | inx
|
---|
804 | lda #23
|
---|
805 | bset 2,x #4
|
---|
806 | brclr *bot #8 foo
|
---|
807 |
|
---|
808 | The following addressing modes are understood for 68HC11 and 68HC12:
|
---|
809 | "Immediate"
|
---|
810 | `#NUMBER'
|
---|
811 |
|
---|
812 | "Address Register"
|
---|
813 | `NUMBER,X', `NUMBER,Y'
|
---|
814 |
|
---|
815 | The NUMBER may be omitted in which case 0 is assumed.
|
---|
816 |
|
---|
817 | "Direct Addressing mode"
|
---|
818 | `*SYMBOL', or `*DIGITS'
|
---|
819 |
|
---|
820 | "Absolute"
|
---|
821 | `SYMBOL', or `DIGITS'
|
---|
822 |
|
---|
823 | The M68HC12 has other more complex addressing modes. All of them are
|
---|
824 | supported and they are represented below:
|
---|
825 |
|
---|
826 | "Constant Offset Indexed Addressing Mode"
|
---|
827 | `NUMBER,REG'
|
---|
828 |
|
---|
829 | The NUMBER may be omitted in which case 0 is assumed. The
|
---|
830 | register can be either `X', `Y', `SP' or `PC'. The assembler will
|
---|
831 | use the smaller post-byte definition according to the constant
|
---|
832 | value (5-bit constant offset, 9-bit constant offset or 16-bit
|
---|
833 | constant offset). If the constant is not known by the assembler
|
---|
834 | it will use the 16-bit constant offset post-byte and the value
|
---|
835 | will be resolved at link time.
|
---|
836 |
|
---|
837 | "Offset Indexed Indirect"
|
---|
838 | `[NUMBER,REG]'
|
---|
839 |
|
---|
840 | The register can be either `X', `Y', `SP' or `PC'.
|
---|
841 |
|
---|
842 | "Auto Pre-Increment/Pre-Decrement/Post-Increment/Post-Decrement"
|
---|
843 | `NUMBER,-REG' `NUMBER,+REG' `NUMBER,REG-' `NUMBER,REG+'
|
---|
844 |
|
---|
845 | The number must be in the range `-8'..`+8' and must not be 0. The
|
---|
846 | register can be either `X', `Y', `SP' or `PC'.
|
---|
847 |
|
---|
848 | "Accumulator Offset"
|
---|
849 | `ACC,REG'
|
---|
850 |
|
---|
851 | The accumulator register can be either `A', `B' or `D'. The
|
---|
852 | register can be either `X', `Y', `SP' or `PC'.
|
---|
853 |
|
---|
854 | "Accumulator D offset indexed-indirect"
|
---|
855 | `[D,REG]'
|
---|
856 |
|
---|
857 | The register can be either `X', `Y', `SP' or `PC'.
|
---|
858 |
|
---|
859 | For example:
|
---|
860 |
|
---|
861 | ldab 1024,sp
|
---|
862 | ldd [10,x]
|
---|
863 | orab 3,+x
|
---|
864 | stab -2,y-
|
---|
865 | ldx a,pc
|
---|
866 | sty [d,sp]
|
---|
867 |
|
---|
868 |
|
---|
869 | File: as.info, Node: M68HC11-Modifiers, Next: M68HC11-Directives, Prev: M68HC11-Syntax, Up: M68HC11-Dependent
|
---|
870 |
|
---|
871 | Symbolic Operand Modifiers
|
---|
872 | --------------------------
|
---|
873 |
|
---|
874 | The assembler supports several modifiers when using symbol addresses
|
---|
875 | in 68HC11 and 68HC12 instruction operands. The general syntax is the
|
---|
876 | following:
|
---|
877 |
|
---|
878 | %modifier(symbol)
|
---|
879 |
|
---|
880 | `%addr'
|
---|
881 | This modifier indicates to the assembler and linker to use the
|
---|
882 | 16-bit physical address corresponding to the symbol. This is
|
---|
883 | intended to be used on memory window systems to map a symbol in
|
---|
884 | the memory bank window. If the symbol is in a memory expansion
|
---|
885 | part, the physical address corresponds to the symbol address
|
---|
886 | within the memory bank window. If the symbol is not in a memory
|
---|
887 | expansion part, this is the symbol address (using or not using the
|
---|
888 | %addr modifier has no effect in that case).
|
---|
889 |
|
---|
890 | `%page'
|
---|
891 | This modifier indicates to use the memory page number corresponding
|
---|
892 | to the symbol. If the symbol is in a memory expansion part, its
|
---|
893 | page number is computed by the linker as a number used to map the
|
---|
894 | page containing the symbol in the memory bank window. If the
|
---|
895 | symbol is not in a memory expansion part, the page number is 0.
|
---|
896 |
|
---|
897 | `%hi'
|
---|
898 | This modifier indicates to use the 8-bit high part of the physical
|
---|
899 | address of the symbol.
|
---|
900 |
|
---|
901 | `%lo'
|
---|
902 | This modifier indicates to use the 8-bit low part of the physical
|
---|
903 | address of the symbol.
|
---|
904 |
|
---|
905 | For example a 68HC12 call to a function `foo_example' stored in
|
---|
906 | memory expansion part could be written as follows:
|
---|
907 |
|
---|
908 | call %addr(foo_example),%page(foo_example)
|
---|
909 |
|
---|
910 | and this is equivalent to
|
---|
911 |
|
---|
912 | call foo_example
|
---|
913 |
|
---|
914 | And for 68HC11 it could be written as follows:
|
---|
915 |
|
---|
916 | ldab #%page(foo_example)
|
---|
917 | stab _page_switch
|
---|
918 | jsr %addr(foo_example)
|
---|
919 |
|
---|
920 |
|
---|
921 | File: as.info, Node: M68HC11-Directives, Next: M68HC11-Float, Prev: M68HC11-Modifiers, Up: M68HC11-Dependent
|
---|
922 |
|
---|
923 | Assembler Directives
|
---|
924 | --------------------
|
---|
925 |
|
---|
926 | The 68HC11 and 68HC12 version of `as' have the following specific
|
---|
927 | assembler directives:
|
---|
928 |
|
---|
929 | `.relax'
|
---|
930 | The relax directive is used by the `GNU Compiler' to emit a
|
---|
931 | specific relocation to mark a group of instructions for linker
|
---|
932 | relaxation. The sequence of instructions within the group must be
|
---|
933 | known to the linker so that relaxation can be performed.
|
---|
934 |
|
---|
935 | `.mode [mshort|mlong|mshort-double|mlong-double]'
|
---|
936 | This directive specifies the ABI. It overrides the `-mshort',
|
---|
937 | `-mlong', `-mshort-double' and `-mlong-double' options.
|
---|
938 |
|
---|
939 | `.far SYMBOL'
|
---|
940 | This directive marks the symbol as a `far' symbol meaning that it
|
---|
941 | uses a `call/rtc' calling convention as opposed to `jsr/rts'.
|
---|
942 | During a final link, the linker will identify references to the
|
---|
943 | `far' symbol and will verify the proper calling convention.
|
---|
944 |
|
---|
945 | `.interrupt SYMBOL'
|
---|
946 | This directive marks the symbol as an interrupt entry point. This
|
---|
947 | information is then used by the debugger to correctly unwind the
|
---|
948 | frame across interrupts.
|
---|
949 |
|
---|
950 | `.xrefb SYMBOL'
|
---|
951 | This directive is defined for compatibility with the
|
---|
952 | `Specification for Motorola 8 and 16-Bit Assembly Language Input
|
---|
953 | Standard' and is ignored.
|
---|
954 |
|
---|
955 |
|
---|
956 | File: as.info, Node: M68HC11-Float, Next: M68HC11-opcodes, Prev: M68HC11-Directives, Up: M68HC11-Dependent
|
---|
957 |
|
---|
958 | Floating Point
|
---|
959 | --------------
|
---|
960 |
|
---|
961 | Packed decimal (P) format floating literals are not supported. Feel
|
---|
962 | free to add the code!
|
---|
963 |
|
---|
964 | The floating point formats generated by directives are these.
|
---|
965 |
|
---|
966 | `.float'
|
---|
967 | `Single' precision floating point constants.
|
---|
968 |
|
---|
969 | `.double'
|
---|
970 | `Double' precision floating point constants.
|
---|
971 |
|
---|
972 | `.extend'
|
---|
973 | `.ldouble'
|
---|
974 | `Extended' precision (`long double') floating point constants.
|
---|
975 |
|
---|
976 |
|
---|
977 | File: as.info, Node: M68HC11-opcodes, Prev: M68HC11-Float, Up: M68HC11-Dependent
|
---|
978 |
|
---|
979 | Opcodes
|
---|
980 | -------
|
---|
981 |
|
---|
982 | * Menu:
|
---|
983 |
|
---|
984 | * M68HC11-Branch:: Branch Improvement
|
---|
985 |
|
---|
986 |
|
---|
987 | File: as.info, Node: M68HC11-Branch, Up: M68HC11-opcodes
|
---|
988 |
|
---|
989 | Branch Improvement
|
---|
990 | ..................
|
---|
991 |
|
---|
992 | Certain pseudo opcodes are permitted for branch instructions. They
|
---|
993 | expand to the shortest branch instruction that reach the target.
|
---|
994 | Generally these mnemonics are made by prepending `j' to the start of
|
---|
995 | Motorola mnemonic. These pseudo opcodes are not affected by the
|
---|
996 | `--short-branchs' or `--force-long-branchs' options.
|
---|
997 |
|
---|
998 | The following table summarizes the pseudo-operations.
|
---|
999 |
|
---|
1000 | Displacement Width
|
---|
1001 | +-------------------------------------------------------------+
|
---|
1002 | | Options |
|
---|
1003 | | --short-branchs --force-long-branchs |
|
---|
1004 | +--------------------------+----------------------------------+
|
---|
1005 | Op |BYTE WORD | BYTE WORD |
|
---|
1006 | +--------------------------+----------------------------------+
|
---|
1007 | bsr | bsr <pc-rel> <error> | jsr <abs> |
|
---|
1008 | bra | bra <pc-rel> <error> | jmp <abs> |
|
---|
1009 | jbsr | bsr <pc-rel> jsr <abs> | bsr <pc-rel> jsr <abs> |
|
---|
1010 | jbra | bra <pc-rel> jmp <abs> | bra <pc-rel> jmp <abs> |
|
---|
1011 | bXX | bXX <pc-rel> <error> | bNX +3; jmp <abs> |
|
---|
1012 | jbXX | bXX <pc-rel> bNX +3; | bXX <pc-rel> bNX +3; jmp <abs> |
|
---|
1013 | | jmp <abs> | |
|
---|
1014 | +--------------------------+----------------------------------+
|
---|
1015 | XX: condition
|
---|
1016 | NX: negative of condition XX
|
---|
1017 |
|
---|
1018 | `jbsr'
|
---|
1019 | `jbra'
|
---|
1020 | These are the simplest jump pseudo-operations; they always map to
|
---|
1021 | one particular machine instruction, depending on the displacement
|
---|
1022 | to the branch target.
|
---|
1023 |
|
---|
1024 | `jbXX'
|
---|
1025 | Here, `jbXX' stands for an entire family of pseudo-operations,
|
---|
1026 | where XX is a conditional branch or condition-code test. The full
|
---|
1027 | list of pseudo-ops in this family is:
|
---|
1028 | jbcc jbeq jbge jbgt jbhi jbvs jbpl jblo
|
---|
1029 | jbcs jbne jblt jble jbls jbvc jbmi
|
---|
1030 |
|
---|
1031 | For the cases of non-PC relative displacements and long
|
---|
1032 | displacements, `as' issues a longer code fragment in terms of NX,
|
---|
1033 | the opposite condition to XX. For example, for the non-PC
|
---|
1034 | relative case:
|
---|
1035 | jbXX foo
|
---|
1036 | gives
|
---|
1037 | bNXs oof
|
---|
1038 | jmp foo
|
---|
1039 | oof:
|
---|
1040 |
|
---|
1041 |
|
---|
1042 | File: as.info, Node: M88K-Dependent, Next: MIPS-Dependent, Prev: M68HC11-Dependent, Up: Machine Dependencies
|
---|
1043 |
|
---|
1044 | Motorola M88K Dependent Features
|
---|
1045 | ================================
|
---|
1046 |
|
---|
1047 | * Menu:
|
---|
1048 |
|
---|
1049 | * M88K Directives:: M88K Machine Directives
|
---|
1050 |
|
---|
1051 |
|
---|
1052 | File: as.info, Node: M88K Directives, Up: M88K-Dependent
|
---|
1053 |
|
---|
1054 | M88K Machine Directives
|
---|
1055 | -----------------------
|
---|
1056 |
|
---|
1057 | The M88K version of the assembler supports the following machine
|
---|
1058 | directives:
|
---|
1059 |
|
---|
1060 | `.align'
|
---|
1061 | This directive aligns the section program counter on the next
|
---|
1062 | 4-byte boundary.
|
---|
1063 |
|
---|
1064 | `.dfloat EXPR'
|
---|
1065 | This assembles a double precision (64-bit) floating point constant.
|
---|
1066 |
|
---|
1067 | `.ffloat EXPR'
|
---|
1068 | This assembles a single precision (32-bit) floating point constant.
|
---|
1069 |
|
---|
1070 | `.half EXPR'
|
---|
1071 | This directive assembles a half-word (16-bit) constant.
|
---|
1072 |
|
---|
1073 | `.word EXPR'
|
---|
1074 | This assembles a word (32-bit) constant.
|
---|
1075 |
|
---|
1076 | `.string "STR"'
|
---|
1077 | This directive behaves like the standard `.ascii' directive for
|
---|
1078 | copying STR into the object file. The string is not terminated
|
---|
1079 | with a null byte.
|
---|
1080 |
|
---|
1081 | `.set SYMBOL, VALUE'
|
---|
1082 | This directive creates a symbol named SYMBOL which is an alias for
|
---|
1083 | another symbol (possibly not yet defined). This should not be
|
---|
1084 | confused with the mnemonic `set', which is a legitimate M88K
|
---|
1085 | instruction.
|
---|
1086 |
|
---|
1087 | `.def SYMBOL, VALUE'
|
---|
1088 | This directive is synonymous with `.set' and is presumably provided
|
---|
1089 | for compatibility with other M88K assemblers.
|
---|
1090 |
|
---|
1091 | `.bss SYMBOL, LENGTH, ALIGN'
|
---|
1092 | Reserve LENGTH bytes in the bss section for a local SYMBOL,
|
---|
1093 | aligned to the power of two specified by ALIGN. LENGTH and ALIGN
|
---|
1094 | must be positive absolute expressions. This directive differs
|
---|
1095 | from `.lcomm' only in that it permits you to specify an alignment.
|
---|
1096 | *Note `.lcomm': Lcomm.
|
---|
1097 |
|
---|
1098 |
|
---|
1099 | File: as.info, Node: MIPS-Dependent, Next: MMIX-Dependent, Prev: M88K-Dependent, Up: Machine Dependencies
|
---|
1100 |
|
---|
1101 | MIPS Dependent Features
|
---|
1102 | =======================
|
---|
1103 |
|
---|
1104 | GNU `as' for MIPS architectures supports several different MIPS
|
---|
1105 | processors, and MIPS ISA levels I through V, MIPS32, and MIPS64. For
|
---|
1106 | information about the MIPS instruction set, see `MIPS RISC
|
---|
1107 | Architecture', by Kane and Heindrich (Prentice-Hall). For an overview
|
---|
1108 | of MIPS assembly conventions, see "Appendix D: Assembly Language
|
---|
1109 | Programming" in the same work.
|
---|
1110 |
|
---|
1111 | * Menu:
|
---|
1112 |
|
---|
1113 | * MIPS Opts:: Assembler options
|
---|
1114 | * MIPS Object:: ECOFF object code
|
---|
1115 | * MIPS Stabs:: Directives for debugging information
|
---|
1116 | * MIPS ISA:: Directives to override the ISA level
|
---|
1117 | * MIPS autoextend:: Directives for extending MIPS 16 bit instructions
|
---|
1118 | * MIPS insn:: Directive to mark data as an instruction
|
---|
1119 | * MIPS option stack:: Directives to save and restore options
|
---|
1120 | * MIPS ASE instruction generation overrides:: Directives to control
|
---|
1121 | generation of MIPS ASE instructions
|
---|
1122 |
|
---|
1123 |
|
---|
1124 | File: as.info, Node: MIPS Opts, Next: MIPS Object, Up: MIPS-Dependent
|
---|
1125 |
|
---|
1126 | Assembler options
|
---|
1127 | -----------------
|
---|
1128 |
|
---|
1129 | The MIPS configurations of GNU `as' support these special options:
|
---|
1130 |
|
---|
1131 | `-G NUM'
|
---|
1132 | This option sets the largest size of an object that can be
|
---|
1133 | referenced implicitly with the `gp' register. It is only accepted
|
---|
1134 | for targets that use ECOFF format. The default value is 8.
|
---|
1135 |
|
---|
1136 | `-EB'
|
---|
1137 | `-EL'
|
---|
1138 | Any MIPS configuration of `as' can select big-endian or
|
---|
1139 | little-endian output at run time (unlike the other GNU development
|
---|
1140 | tools, which must be configured for one or the other). Use `-EB'
|
---|
1141 | to select big-endian output, and `-EL' for little-endian.
|
---|
1142 |
|
---|
1143 | `-mips1'
|
---|
1144 | `-mips2'
|
---|
1145 | `-mips3'
|
---|
1146 | `-mips4'
|
---|
1147 | `-mips5'
|
---|
1148 | `-mips32'
|
---|
1149 | `-mips32r2'
|
---|
1150 | `-mips64'
|
---|
1151 | Generate code for a particular MIPS Instruction Set Architecture
|
---|
1152 | level. `-mips1' corresponds to the R2000 and R3000 processors,
|
---|
1153 | `-mips2' to the R6000 processor, `-mips3' to the R4000 processor,
|
---|
1154 | and `-mips4' to the R8000 and R10000 processors. `-mips5',
|
---|
1155 | `-mips32', `-mips32r2', and `-mips64' correspond to generic MIPS
|
---|
1156 | V, MIPS32, MIPS32 RELEASE 2, and MIPS64 ISA processors,
|
---|
1157 | respectively. You can also switch instruction sets during the
|
---|
1158 | assembly; see *Note Directives to override the ISA level: MIPS ISA.
|
---|
1159 |
|
---|
1160 | `-mgp32'
|
---|
1161 | `-mfp32'
|
---|
1162 | Some macros have different expansions for 32-bit and 64-bit
|
---|
1163 | registers. The register sizes are normally inferred from the ISA
|
---|
1164 | and ABI, but these flags force a certain group of registers to be
|
---|
1165 | treated as 32 bits wide at all times. `-mgp32' controls the size
|
---|
1166 | of general-purpose registers and `-mfp32' controls the size of
|
---|
1167 | floating-point registers.
|
---|
1168 |
|
---|
1169 | On some MIPS variants there is a 32-bit mode flag; when this flag
|
---|
1170 | is set, 64-bit instructions generate a trap. Also, some 32-bit
|
---|
1171 | OSes only save the 32-bit registers on a context switch, so it is
|
---|
1172 | essential never to use the 64-bit registers.
|
---|
1173 |
|
---|
1174 | `-mgp64'
|
---|
1175 | Assume that 64-bit general purpose registers are available. This
|
---|
1176 | is provided in the interests of symmetry with -gp32.
|
---|
1177 |
|
---|
1178 | `-mips16'
|
---|
1179 | `-no-mips16'
|
---|
1180 | Generate code for the MIPS 16 processor. This is equivalent to
|
---|
1181 | putting `.set mips16' at the start of the assembly file.
|
---|
1182 | `-no-mips16' turns off this option.
|
---|
1183 |
|
---|
1184 | `-mips3d'
|
---|
1185 | `-no-mips3d'
|
---|
1186 | Generate code for the MIPS-3D Application Specific Extension.
|
---|
1187 | This tells the assembler to accept MIPS-3D instructions.
|
---|
1188 | `-no-mips3d' turns off this option.
|
---|
1189 |
|
---|
1190 | `-mdmx'
|
---|
1191 | `-no-mdmx'
|
---|
1192 | Generate code for the MDMX Application Specific Extension. This
|
---|
1193 | tells the assembler to accept MDMX instructions. `-no-mdmx' turns
|
---|
1194 | off this option.
|
---|
1195 |
|
---|
1196 | `-mfix7000'
|
---|
1197 | `-mno-fix7000'
|
---|
1198 | Cause nops to be inserted if the read of the destination register
|
---|
1199 | of an mfhi or mflo instruction occurs in the following two
|
---|
1200 | instructions.
|
---|
1201 |
|
---|
1202 | `-mfix-vr4122-bugs'
|
---|
1203 | `-no-mfix-vr4122-bugs'
|
---|
1204 | Insert `nop' instructions to avoid errors in certain versions of
|
---|
1205 | the vr4122 core. This option is intended to be used on
|
---|
1206 | GCC-generated code: it is not designed to catch errors in
|
---|
1207 | hand-written assembler code.
|
---|
1208 |
|
---|
1209 | `-m4010'
|
---|
1210 | `-no-m4010'
|
---|
1211 | Generate code for the LSI R4010 chip. This tells the assembler to
|
---|
1212 | accept the R4010 specific instructions (`addciu', `ffc', etc.),
|
---|
1213 | and to not schedule `nop' instructions around accesses to the `HI'
|
---|
1214 | and `LO' registers. `-no-m4010' turns off this option.
|
---|
1215 |
|
---|
1216 | `-m4650'
|
---|
1217 | `-no-m4650'
|
---|
1218 | Generate code for the MIPS R4650 chip. This tells the assembler
|
---|
1219 | to accept the `mad' and `madu' instruction, and to not schedule
|
---|
1220 | `nop' instructions around accesses to the `HI' and `LO' registers.
|
---|
1221 | `-no-m4650' turns off this option.
|
---|
1222 |
|
---|
1223 | `-m3900'
|
---|
1224 | `-no-m3900'
|
---|
1225 | `-m4100'
|
---|
1226 | `-no-m4100'
|
---|
1227 | For each option `-mNNNN', generate code for the MIPS RNNNN chip.
|
---|
1228 | This tells the assembler to accept instructions specific to that
|
---|
1229 | chip, and to schedule for that chip's hazards.
|
---|
1230 |
|
---|
1231 | `-march=CPU'
|
---|
1232 | Generate code for a particular MIPS cpu. It is exactly equivalent
|
---|
1233 | to `-mCPU', except that there are more value of CPU understood.
|
---|
1234 | Valid CPU value are:
|
---|
1235 |
|
---|
1236 | 2000, 3000, 3900, 4000, 4010, 4100, 4111, vr4120, vr4130,
|
---|
1237 | vr4181, 4300, 4400, 4600, 4650, 5000, rm5200, rm5230, rm5231,
|
---|
1238 | rm5261, rm5721, vr5400, vr5500, 6000, rm7000, 8000, 10000,
|
---|
1239 | 12000, mips32-4k, sb1
|
---|
1240 |
|
---|
1241 | `-mtune=CPU'
|
---|
1242 | Schedule and tune for a particular MIPS cpu. Valid CPU values are
|
---|
1243 | identical to `-march=CPU'.
|
---|
1244 |
|
---|
1245 | `-mabi=ABI'
|
---|
1246 | Record which ABI the source code uses. The recognized arguments
|
---|
1247 | are: `32', `n32', `o64', `64' and `eabi'.
|
---|
1248 |
|
---|
1249 | `-nocpp'
|
---|
1250 | This option is ignored. It is accepted for command-line
|
---|
1251 | compatibility with other assemblers, which use it to turn off C
|
---|
1252 | style preprocessing. With GNU `as', there is no need for
|
---|
1253 | `-nocpp', because the GNU assembler itself never runs the C
|
---|
1254 | preprocessor.
|
---|
1255 |
|
---|
1256 | `--construct-floats'
|
---|
1257 | `--no-construct-floats'
|
---|
1258 | The `--no-construct-floats' option disables the construction of
|
---|
1259 | double width floating point constants by loading the two halves of
|
---|
1260 | the value into the two single width floating point registers that
|
---|
1261 | make up the double width register. This feature is useful if the
|
---|
1262 | processor support the FR bit in its status register, and this bit
|
---|
1263 | is known (by the programmer) to be set. This bit prevents the
|
---|
1264 | aliasing of the double width register by the single width
|
---|
1265 | registers.
|
---|
1266 |
|
---|
1267 | By default `--construct-floats' is selected, allowing construction
|
---|
1268 | of these floating point constants.
|
---|
1269 |
|
---|
1270 | `--trap'
|
---|
1271 | `--no-break'
|
---|
1272 | `as' automatically macro expands certain division and
|
---|
1273 | multiplication instructions to check for overflow and division by
|
---|
1274 | zero. This option causes `as' to generate code to take a trap
|
---|
1275 | exception rather than a break exception when an error is detected.
|
---|
1276 | The trap instructions are only supported at Instruction Set
|
---|
1277 | Architecture level 2 and higher.
|
---|
1278 |
|
---|
1279 | `--break'
|
---|
1280 | `--no-trap'
|
---|
1281 | Generate code to take a break exception rather than a trap
|
---|
1282 | exception when an error is detected. This is the default.
|
---|
1283 |
|
---|
1284 | `-n'
|
---|
1285 | When this option is used, `as' will issue a warning every time it
|
---|
1286 | generates a nop instruction from a macro.
|
---|
1287 |
|
---|
1288 |
|
---|
1289 | File: as.info, Node: MIPS Object, Next: MIPS Stabs, Prev: MIPS Opts, Up: MIPS-Dependent
|
---|
1290 |
|
---|
1291 | MIPS ECOFF object code
|
---|
1292 | ----------------------
|
---|
1293 |
|
---|
1294 | Assembling for a MIPS ECOFF target supports some additional sections
|
---|
1295 | besides the usual `.text', `.data' and `.bss'. The additional sections
|
---|
1296 | are `.rdata', used for read-only data, `.sdata', used for small data,
|
---|
1297 | and `.sbss', used for small common objects.
|
---|
1298 |
|
---|
1299 | When assembling for ECOFF, the assembler uses the `$gp' (`$28')
|
---|
1300 | register to form the address of a "small object". Any object in the
|
---|
1301 | `.sdata' or `.sbss' sections is considered "small" in this sense. For
|
---|
1302 | external objects, or for objects in the `.bss' section, you can use the
|
---|
1303 | `gcc' `-G' option to control the size of objects addressed via `$gp';
|
---|
1304 | the default value is 8, meaning that a reference to any object eight
|
---|
1305 | bytes or smaller uses `$gp'. Passing `-G 0' to `as' prevents it from
|
---|
1306 | using the `$gp' register on the basis of object size (but the assembler
|
---|
1307 | uses `$gp' for objects in `.sdata' or `sbss' in any case). The size of
|
---|
1308 | an object in the `.bss' section is set by the `.comm' or `.lcomm'
|
---|
1309 | directive that defines it. The size of an external object may be set
|
---|
1310 | with the `.extern' directive. For example, `.extern sym,4' declares
|
---|
1311 | that the object at `sym' is 4 bytes in length, whie leaving `sym'
|
---|
1312 | otherwise undefined.
|
---|
1313 |
|
---|
1314 | Using small ECOFF objects requires linker support, and assumes that
|
---|
1315 | the `$gp' register is correctly initialized (normally done
|
---|
1316 | automatically by the startup code). MIPS ECOFF assembly code must not
|
---|
1317 | modify the `$gp' register.
|
---|
1318 |
|
---|
1319 |
|
---|
1320 | File: as.info, Node: MIPS Stabs, Next: MIPS ISA, Prev: MIPS Object, Up: MIPS-Dependent
|
---|
1321 |
|
---|
1322 | Directives for debugging information
|
---|
1323 | ------------------------------------
|
---|
1324 |
|
---|
1325 | MIPS ECOFF `as' supports several directives used for generating
|
---|
1326 | debugging information which are not support by traditional MIPS
|
---|
1327 | assemblers. These are `.def', `.endef', `.dim', `.file', `.scl',
|
---|
1328 | `.size', `.tag', `.type', `.val', `.stabd', `.stabn', and `.stabs'.
|
---|
1329 | The debugging information generated by the three `.stab' directives can
|
---|
1330 | only be read by GDB, not by traditional MIPS debuggers (this
|
---|
1331 | enhancement is required to fully support C++ debugging). These
|
---|
1332 | directives are primarily used by compilers, not assembly language
|
---|
1333 | programmers!
|
---|
1334 |
|
---|