asm.pl
x86-64 assembly as terms, and their printer as GNU as (AT&T) text. The backends build a list of lines; this module is the only place that knows AT&T syntax.
Lines
| Line | Prints as |
|---|---|
labelS | S: |
insOp, Suffix, Operands | Op, then Suffix unless it is none, then the operands in AT&T order (sources first) |
| a directive | the directive, below |
| Directive | Prints as |
|---|---|
sectionS | the section S: text, data, rodata, bss, data_rel_ro or note_gnu_stack |
p2alignN balignN | .p2align N, .balign N |
globlS weakS hiddenS | .globl S, .weak S, .hidden S |
typeS, T | .type S, @T, T function or object |
sizeS | .size S, .-S |
sizeS, N | .size S, N |
setS, E | .set S, E |
quadE | .quad E |
longN intN shortN | .long N, .int N, .short N |
byteNs | .byte and the non-empty list Ns |
zeroN | .zero N |
asciiChars | .ascii and the characters, escaped |
ascizAtom | .asciz and the atom, as it is |
Operands
Operands name concrete registers, so mixed widths such as movzbl %al, %eax need no width bookkeeping.
| Operand | Prints as |
|---|---|
immE | $E |
regR | %R, for example regeax, regcl, regr9d |
memD, B | D(%B), D omitted when 0 |
memD, B, I | D(%B,%I), D omitted when 0 |
ripE | E(%rip) |
gotpcrelS | S@GOTPCREL(%rip) |
pltS | S@PLT |
symE | E, a jump or call target |
indO | *O |
An expression E is an integer, a symbol atom or E1+E2; a left operand that is itself a sum is parenthesized.
The text of one line, committed to its first parse.
the text of Line. directive//1 has no clause for label/1 or ins/3, so the cases are disjoint; line//1 commits to the first parse.
the bytes Cs, one per character, inside an .ascii string: printable ASCII as itself except quote and backslash, which are escaped, newline and tab as \n and \t, any other byte as three octal digits.
O is the octal digit of N at bit Shift.
The text of an atom or number.