Commit | Line | Data |
---|---|---|
d2964941 RH |
1 | .\" |
2 | .\" Copyright (c) 1982 Regents of the University of California | |
b0ab87d8 | 3 | .\" @(#)asdocs3.me 1.5 %G% |
d2964941 | 4 | .\" |
a53a5533 RH |
5 | .EQ |
6 | delim $$ | |
7 | .EN | |
8 | .SH 1 "Pseudo-operations (Directives)" | |
9 | .pp | |
10 | The keywords listed below introduce directives or instructions, | |
11 | and influence the later behavior of the assembler for this statement. | |
12 | The metanotation | |
13 | .ce 1 | |
14 | [ stuff ] | |
15 | .ce 0 | |
16 | means that 0 or more instances of the given | |
17 | .q stuff | |
18 | may appear. | |
19 | .pp | |
20 | .b Boldface | |
21 | tokens must appear literally; | |
22 | words in | |
23 | .i italic | |
24 | words are substitutable. | |
25 | .pp | |
26 | The pseudo\-operations listed below | |
27 | are grouped into functional categories. | |
28 | .SH 2 "Interface to a Previous Pass" | |
29 | .in -2n | |
30 | .TS | |
31 | lb l. | |
32 | \&.ABORT | |
33 | .TE | |
34 | .in +2n | |
35 | .pp | |
36 | As soon as the assembler sees this directive, | |
37 | it ignores all further input | |
38 | (but it does read to the end of file), | |
39 | and aborts the assembly. | |
40 | No files are created. | |
41 | It is anticipated that this would be used in a pipe interconnected | |
42 | version of a compiler, | |
43 | where the first major syntax error would | |
44 | cause the compiler to issue this directive, | |
45 | saving unnecessary work in assembling code | |
46 | that would have to be discarded anyway. | |
47 | .in -2n | |
48 | .TS | |
49 | lb l. | |
50 | \&.file $string$ | |
51 | .TE | |
52 | .in +2n | |
53 | .pp | |
54 | This directive causes the assembler to think it is in file | |
55 | .i string , | |
56 | so error messages reflect the proper source file. | |
57 | .in -2n | |
58 | .TS | |
59 | lb l. | |
60 | \&.line $expression$ | |
61 | .TE | |
62 | .in +2n | |
63 | .pp | |
64 | This directive causes the assembler to think it is on line | |
65 | .i expression | |
66 | so error messages reflect the proper source file. | |
67 | .pp | |
68 | The only effect of assembling multiple files specified in the command string | |
69 | is to insert the | |
70 | .i file | |
71 | and | |
72 | .i line | |
73 | directives, | |
74 | with the appropriate values, | |
75 | at the beginning of the source from each file. | |
76 | .in -2n | |
77 | .TS | |
78 | lb l. | |
79 | # $expression$ $string$ | |
80 | # $expression$ | |
81 | .TE | |
82 | .in +2n | |
83 | .pp | |
84 | This is the only instance where a comment is meaningful to the assembler. | |
85 | The | |
86 | .q "#" | |
87 | .ul 1 | |
88 | must | |
89 | be in the first column. | |
90 | This meta comment causes the assembler | |
91 | to believe it is on line | |
92 | .i expression . | |
93 | The second argument, | |
94 | if included, | |
95 | causes the assembler to believe it is in file | |
96 | .i string , | |
97 | otherwise the current file name does not change. | |
98 | .SH 2 "Location Counter Control" | |
99 | .in -2n | |
100 | .TS | |
101 | lb l. | |
102 | \&.data [ $expression$ ] | |
103 | \&.text [ $expression$ ] | |
104 | .TE | |
105 | .in +2n | |
106 | .pp | |
107 | These two pseudo-operations cause the | |
108 | assembler to begin assembling into the indicated text or data | |
109 | subsegment. | |
110 | If specified, | |
111 | the | |
112 | .i expression | |
113 | must be defined and absolute; | |
114 | an omitted | |
115 | .i expression | |
116 | is treated as zero. | |
117 | The effect of a | |
118 | .b .data | |
119 | directive is treated | |
120 | as a | |
121 | .b .text | |
122 | directive if the | |
123 | .b \-R | |
124 | assembly flag is set. | |
125 | Assembly starts in the | |
126 | .b ".text" | |
127 | 0 subsegment. | |
128 | .pp | |
129 | The directives | |
130 | .b .align | |
131 | and | |
132 | .b .org | |
133 | also control the placement of the location counter. | |
134 | .sh 2 "Filled Data" | |
135 | .in -2n | |
136 | .TS | |
137 | lb l. | |
138 | \&.align $align\*(USexpr$ [ \fB,\fP $fill\*(USexpr$ ] | |
139 | .TE | |
140 | .in +2n | |
141 | .pp | |
142 | The location counter is adjusted | |
143 | so that the | |
144 | .i expression | |
145 | lowest bits of the location counter become zero. | |
146 | This is done by | |
147 | assembling from 0 to $2 sup align\*(USexpr$ bytes, | |
148 | taken from the low order byte of $fill\*(USexpr$. | |
149 | If present, | |
150 | $fill\*(USexpr$ must be absolute; | |
151 | otherwise it defaults to 0. | |
152 | Thus | |
153 | .q ".align 2" | |
154 | pads by null bytes to make the location counter | |
155 | evenly divisible by 4. | |
156 | The | |
157 | .i align_expr | |
158 | must be defined, | |
159 | absolute, nonnegative, | |
160 | and less than 16. | |
161 | .pp | |
162 | Warning: | |
163 | the subsegment concatenation convention | |
164 | and the current loader conventions | |
165 | may not preserve attempts at aligning | |
166 | to more than 2 low-order zero bits. | |
167 | .in -2n | |
168 | .TS | |
169 | lb l. | |
170 | \&.org $org\*(USexpr$ [ \fB,\fP $fill\*(USexpr$ ] | |
171 | .TE | |
172 | .in +2n | |
173 | .pp | |
174 | The location counter is set equal to the value of $org\*(USexpr$, | |
175 | which must be defined and absolute. | |
176 | The value of the $org\*(USexpr$ | |
177 | must be greater than the current value | |
178 | of the location counter. | |
179 | Space between the current value of the location counter | |
180 | and the desired value are filled with bytes taken from the | |
181 | low order byte of $fill\*(USexpr$, | |
182 | which must be absolute and defaults to 0. | |
183 | .in -2n | |
184 | .TS | |
185 | lb l. | |
186 | \&.space $space\*(USexpr$ [ \fB,\fP $fill\*(USexpr$ ] | |
187 | .TE | |
188 | .in +2n | |
189 | .pp | |
190 | The location counter is advanced by | |
191 | $space\*(USexpr$ bytes. | |
192 | $Space\*(USexpr$ must be defined and absolute. | |
193 | The space is filled in with bytes taken from the low order | |
194 | byte of $fill\*(USexpr$, | |
195 | which must be defined and absolute. | |
196 | $Fill\*(USexpr$ defaults to 0. | |
197 | The | |
198 | .b .fill | |
199 | directive is a more general way to accomplish the | |
200 | .b .space | |
201 | directive. | |
202 | .in -2n | |
203 | .TS | |
204 | lb l. | |
205 | \&.fill $rep\*(USexpr$\fB,\fP $size\*(USexpr$\fB,\fP $fill\*(USexpr$ | |
206 | .TE | |
207 | .in +2n | |
208 | .pp | |
209 | All three expressions must be absolute. | |
210 | .i fill\*(USexpr , | |
211 | treated as an expression of size | |
212 | .i size\*(USexpr | |
213 | bytes, | |
214 | is assembled and replicated | |
215 | .i rep\*(USexpr | |
216 | times. | |
217 | The effect is to advance the current location counter | |
218 | .i rep\*(USexpr | |
219 | \(** | |
220 | .i size\*(USexpr | |
221 | bytes. | |
222 | .i size\*(USexpr | |
223 | must be between 1 and 8. | |
224 | .SH 2 "Symbol Definitions" | |
225 | .SH 2 "Initialized Data" | |
226 | .in -2n | |
227 | .TS | |
228 | lb l. | |
229 | \&.byte $expr$ [ \fB,\fP $expr$ ] | |
230 | \&.word $expr$ [ \fB,\fP $expr$ ] | |
231 | \&.int $expr$ [ \fB,\fP $expr$ ] | |
232 | \&.long $expr$ [ \fB,\fP $expr$ ] | |
233 | .TE | |
234 | .in +2n | |
235 | .pp | |
236 | The | |
237 | .i expression s | |
238 | in the comma-separated | |
239 | list are truncated to the size indicated by the key word: | |
240 | .(b | |
241 | .in -2n | |
242 | .TS | |
243 | center; | |
244 | c l | |
245 | rb n. | |
246 | keyword length (bits) | |
247 | _ | |
248 | \&.byte 8 | |
249 | \&.word 16 | |
250 | \&.int 32 | |
251 | \&.long 32 | |
252 | .TE | |
253 | .in +2n | |
254 | .)b | |
255 | and assembled in successive locations. | |
190b7e25 RH |
256 | The |
257 | .i expression s | |
258 | must be absolute. | |
259 | .pp | |
260 | Each | |
261 | .i expression | |
262 | may optionally be of the form: | |
263 | .(b | |
264 | .TS | |
265 | center; | |
266 | $expression sub 1$ : $expression sub 2$ | |
267 | .TE | |
268 | .)b | |
269 | In this case, | |
270 | the value of $expression sub 2$ is truncated | |
271 | to $expression sub 1$ bits, | |
272 | and assembled in the next $expression sub 1$ bit field | |
273 | which fits in the natural data size being assembled. | |
274 | Bits which are skipped because a field does not fit are filled with zeros. | |
275 | Thus, | |
276 | .q "\fB.byte\fP 123" | |
277 | is equivlent to | |
278 | .q "\fB.byte\fP 8:123" , | |
279 | and | |
280 | .q "\fB.byte\fP 3:1,2:1,5:1" | |
281 | assembles two bytes, containing the values 9 and 1. | |
282 | .pp | |
283 | .b NB: | |
284 | Bit field initialization with the colon operator is likely | |
285 | to disappear in future releases of the assembler. | |
a53a5533 RH |
286 | .in -2n |
287 | .TS | |
288 | lb l. | |
289 | \&.quad $number$ [ , $number$ ] | |
290 | \&.octa $number$ [ , $number$ ] | |
291 | \&.float $number$ [ , $number$ ] | |
292 | \&.double $number$ [ , $number$ ] | |
293 | \&.ffloat $number$ [ , $number$ ] | |
294 | \&.dfloat $number$ [ , $number$ ] | |
295 | \&.gfloat $number$ [ , $number$ ] | |
296 | \&.hfloat $number$ [ , $number$ ] | |
297 | .TE | |
298 | .in +2n | |
299 | .pp | |
300 | These intialize Bignums (see \(sc3.2.2) | |
301 | in successive locations whose size is a function on the key word. | |
302 | The type of the Bignums | |
303 | (determined by the exponent field, or lack thereof) | |
304 | may not agree with type implied by the key word. | |
305 | The following table shows the key words, | |
306 | their size, | |
307 | and the data types for the Bignums they expect. | |
308 | .(b | |
309 | .in -2n | |
310 | .TS | |
311 | center; | |
312 | c l l l | |
313 | rb n l l. | |
314 | keyword format length (bits) valid $number$(s) | |
315 | _ | |
316 | \&.quad quad scalar 64 scalar | |
317 | \&.octa octal scalar 128 scalar | |
318 | \&.float F float 32 F, D and scalar | |
319 | \&.ffloat F float 32 F, D and scalar | |
320 | \&.double D float 64 F, D and scalar | |
321 | \&.dfloat D float 64 F, D and scalar | |
322 | \&.gfloat G float 64 G scalar | |
323 | \&.hfloat H float 128 H scalar | |
324 | .TE | |
325 | .in +2n | |
326 | .)b | |
327 | .pp | |
328 | .i As | |
329 | will correctly perform other floating point conversions while initializing, | |
330 | but issues a warning message. | |
331 | .i As | |
332 | performs all floating point initializations and conversions | |
333 | using only the facilities defined | |
334 | in the original (native) architecture. | |
335 | .in -2n | |
336 | .TS | |
337 | lb l. | |
338 | \&.ascii $string$ [ , $string$] | |
339 | \&.asciz $string$ [ , $string$] | |
340 | .TE | |
341 | .in +2n | |
342 | .pp | |
343 | Each | |
344 | .i string | |
345 | in the list is assembled into successive locations, | |
346 | with the first letter in the string being placed | |
347 | into the first location, etc. | |
348 | The | |
349 | .b .ascii | |
350 | directive will not null pad the string; | |
351 | the | |
352 | .b .asciz | |
353 | directive will null pad the string. | |
354 | (Recall that strings are known by their length, | |
355 | and need not be terminated with a null, | |
356 | and that the \*(CL conventions for escaping are understood.) | |
357 | The | |
358 | .b .ascii | |
359 | directive is identical to: | |
360 | .ce 10 | |
361 | \&\fB.byte\fP $string sub 0$\fB,\fP $string sub 1$\fB,\fP $...$ | |
362 | .ce 0 | |
363 | .in -2n | |
364 | .TS | |
365 | lb l. | |
366 | \&.comm name\fB,\fP $expression$ | |
367 | .TE | |
368 | .in +2n | |
369 | .pp | |
370 | Provided the | |
371 | .i name | |
372 | is not defined elsewhere, | |
373 | its type is made | |
374 | .q "undefined external" , | |
375 | and its value is | |
376 | .i expression . | |
377 | In fact the | |
378 | .i name | |
379 | behaves | |
380 | in the current assembly just like an | |
381 | undefined external. | |
382 | However, | |
383 | the link editor | |
384 | .i ld | |
385 | has been special-cased | |
386 | so that all external symbols which are not otherwise defined, | |
387 | and which have a non-zero value, | |
388 | are defined to lie in the bss segment, | |
389 | and enough space is left after the symbol to hold | |
390 | .i expression | |
391 | bytes. | |
392 | .in -2n | |
393 | .TS | |
394 | lb l. | |
395 | \&.lcomm name\fB,\fP $expression$ | |
396 | .TE | |
397 | .in +2n | |
398 | .pp | |
399 | .i expression | |
400 | bytes will be allocated in the bss segment and | |
401 | .i name | |
402 | assigned the location of the first byte, | |
403 | but the | |
404 | .i name | |
405 | is not declared | |
406 | as global and hence will be unknown to the link editor. | |
407 | .in -2n | |
408 | .TS | |
409 | lb l. | |
410 | \&.globl $name$ | |
a53a5533 RH |
411 | .TE |
412 | .in +2n | |
413 | .pp | |
414 | This statement makes the | |
415 | .i name | |
416 | external. | |
417 | If it is otherwise defined (by | |
418 | .b .set | |
419 | or by | |
420 | appearance as a label) | |
421 | it acts within the assembly exactly as if | |
422 | the | |
423 | .b .globl | |
424 | statement were not given; | |
425 | however, | |
426 | the link editor may be used | |
427 | to combine this object module with other modules referring to this symbol. | |
428 | .pp | |
429 | Conversely, | |
430 | if the given symbol is not defined | |
431 | within the current assembly, | |
432 | the link editor can combine the output of this assembly | |
433 | with that of others which define the symbol. | |
434 | The assembler makes all otherwise | |
435 | undefined symbols external. | |
436 | .in -2n | |
437 | .TS | |
438 | lb l. | |
439 | \&.set $name$\fB,\fP $expression$ | |
440 | .TE | |
441 | .in +2n | |
442 | .pp | |
443 | The ($name$, $expression$) | |
444 | pair is entered into the symbol table. | |
445 | Multiple | |
446 | .b .set | |
447 | statements with the same name are legal; | |
448 | the most recent value replaces all previous values. | |
449 | .in -2n | |
450 | .TS | |
451 | lb l. | |
452 | \&.lsym $name$\fB,\fP$ $expression$ | |
453 | .TE | |
454 | .in +2n | |
455 | .pp | |
456 | A unique and otherwise unreferenceable instance of the | |
457 | ($name$, $expression$) | |
458 | pair is created in the symbol table. | |
459 | The Fortran 77 compiler uses this mechanism to pass local symbol definitions | |
460 | to the link editor and debugger. | |
461 | .in -2n | |
462 | .TS | |
463 | lb l. | |
464 | \&.stabs $string$, $expr sub 1$, $expr sub 2$, $expr sub 3$, $expr sub 4$ | |
465 | \&.stabn $expr sub 1$, $expr sub 2$, $expr sub 3$, $expr sub 4$ | |
466 | \&.stabd $expr sub 1$, $expr sub 2$, $expr sub 3$ | |
467 | .TE | |
468 | .in +2n | |
469 | .pp | |
470 | The | |
471 | .i stab | |
472 | directives place symbols in the symbol table for the symbolic | |
473 | debugger, | |
474 | .i sdb \**. | |
475 | .(f | |
476 | \**Katseff, H.P. | |
477 | .i "Sdb: A Symbol Debugger." | |
478 | Bell Laboratories, Holmdel, | |
479 | NJ. April 12, 1979. | |
480 | .br | |
481 | Katseff, H.P. | |
482 | .i "Symbol Table Format for Sdb", | |
483 | File 39394, | |
484 | Bell Laboratores, Holmdel, NJ. March 14, 1979. | |
485 | .)f | |
486 | A | |
487 | .q stab | |
488 | is a | |
489 | .i s ymbol | |
490 | .i tab le | |
491 | entry. | |
492 | The | |
493 | .b .stabs | |
494 | is a string stab, the | |
495 | .b .stabn | |
496 | is a stab not having a string, | |
497 | and the | |
498 | .b .stabd | |
499 | is a | |
500 | .q dot | |
501 | stab that implicitly references | |
502 | .q dot , | |
503 | the current location counter. | |
a53a5533 RH |
504 | .pp |
505 | The | |
506 | .i string | |
507 | in the | |
508 | .b .stabs | |
509 | directive is the name of a symbol. | |
510 | If the symbol name is zero, | |
511 | the | |
512 | .b .stabn | |
513 | directive may be used instead. | |
514 | .pp | |
515 | The other expressions are stored | |
516 | in the name list structure | |
517 | of the symbol table | |
518 | and preserved by the loader for reference by | |
519 | .i sdb ; | |
520 | the value of the expressions are peculiar to formats required by | |
521 | .i sdb . | |
522 | .nr ii \w'$expr sub 1$\ \ 'u | |
523 | .ip $expr sub 1$ | |
524 | is used as a symbol table tag | |
525 | (nlist field | |
526 | .i n\*(UStype ). | |
527 | .ip $expr sub 2$ | |
528 | seems to always be zero | |
529 | (nlist field | |
530 | .i n\*(USother ). | |
531 | .ip $expr sub 3$ | |
532 | is used for either the | |
533 | source line number, | |
534 | or for a nesting level | |
535 | (nlist field | |
536 | .i n\*(USdesc ). | |
537 | .ip $expr sub 4$ | |
538 | is used as tag specific information | |
539 | (nlist field | |
540 | .i n\*(USvalue ). | |
541 | In the | |
542 | case of the | |
543 | .b .stabd | |
544 | directive, this expression is nonexistant, and | |
545 | is taken to be the value of the location counter | |
546 | at the following instruction. | |
547 | Since there is no associated name for a | |
548 | .b .stabd | |
549 | directive, | |
550 | it can | |
551 | only be used in circumstances where the name is zero. | |
552 | The effect of a | |
553 | .b .stabd | |
554 | directive can be achieved by one of the other | |
555 | .b .stab x | |
556 | directives in the following manner: | |
557 | .br | |
558 | $bold .stabn$ $expr sub 1$, $expr sub 2$, $expr sub 3$, $roman LL n$ | |
559 | .br | |
560 | $roman LL n bold :$ | |
561 | .pp | |
562 | The | |
563 | .b .stabd | |
564 | directive is prefered, | |
565 | because it does not clog the symbol | |
566 | table with labels used only for the stab symbol entries. |