[Tex/LaTex] GNU Assembly syntax source listings

listings

Is there a good way to do GNU/AT&T-syntax assembly listings? I've scoured the internet, and so far as I can tell, MASM is the only thing supported.

Best Answer

The minted package can highlight GAS:

\documentclass{article}
\usepackage{minted}
\begin{document}

\begin{minted}{gas}
.global _start

.text
_start:
    movl  $4, %eax
    movl  $1, %ebx
    movl  $msg, %ecx
    movl  $len, %edx
    int   $0x80

    movl  $1, %eax
    movl  $0, %ebx
    int   $0x80
.data
msg:
    .ascii  "Hello, world!\n"
    len =   . - msg
\end{minted}

\end{document}

enter image description here

Related Question