I want to compile intel syntax assembly using gcc. Is it possible? because I cant find something similar. I've only found this post.
Here is the code I am trying to compile.
global _main
section .text
_main:
mov eax, -1
ret
If this is not possible please provide alternative options in your answer.
Adding a .intel_syntax
directive works for me:
.globl _main
.intel_syntax
_main:
mov eax, -1
ret
Assembling and running:
$ gcc -o example example.s; ./example; echo $?
255
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With