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