5

Does anyone know a tutorial for GAS where I can find infos about compiling and linking code in AT&T-Syntax on 64bit Systems? I need this for university, so I cannot use nasm instead. All tuts I can find are either for nasm or something similiar or they only work on 32bit. Even the minimalistic examples shown by our Prof work on my 32bit System but not on 64bit.

1
  • 1
    as [--64] myfile.s -o myfile.o && ld -o myfile myfile.o or gcc [-c] [-nostartfiles] myfile.s should work. If you're trying to create a standalone application you should specify the operating system and architecture (e.g x86_64 linux). Commented Dec 11, 2011 at 12:58

1 Answer 1

2

You just need to change the postfixes of the instructions and the register names. Change this:

movl %ebx, %ecx # to: movq %rbx, %rcx 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.