6

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.

7

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.