Hi,
I need to ask this: I have a C++ kernel, and I would like to use GAS in my inline assembly, so I need to enable the intel syntax. But I forgot the code to do so. Also, I have some inline assembly that is only for AT&T syntax, so I would like to know the command to disable intel syntax, back to AT&T.
What's the code?
Thanks
GAS intel syntax
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:GAS intel syntax
could you be precise at what you'd like to have ? GAS (gnu assembler, correct me if i'm wrong here) is natively using AT&T syntax ... i saw a trick somewhere on this board that enables the intel syntax within it ... is that what you wish ?
Re:GAS intel syntax
Yes. I would like to know the command to enable or disable the intel syntax for GAS. Or, you could give me a link to the GAS instuction list. Thanks
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:GAS intel syntax
i guess you'd be pleased to learn that "GAS Intel syntax" in the search button returned
http://www.mega-tokyo.com/forum/index.p ... 01;start=0
it seems that everything comes from http://www.leto.net/mail/linuxasm/2001/msg00223.html
using "strings /usr/bin/as", it seems that a ".att_syntax" command is available too.
so i guess ".att_syntax prefix" is what you want
(the "prefix" flag is for re-enabling the % prefix for the registers...)
http://www.mega-tokyo.com/forum/index.p ... 01;start=0
it seems that everything comes from http://www.leto.net/mail/linuxasm/2001/msg00223.html
using "strings /usr/bin/as", it seems that a ".att_syntax" command is available too.
so i guess ".att_syntax prefix" is what you want
(the "prefix" flag is for re-enabling the % prefix for the registers...)
Re:GAS intel syntax
Ok, thanks.
But how do I disable this also? I need to because, my inportb and other stuff has some GAS AT&T syntax that it needs. How?
Thanks.
But how do I disable this also? I need to because, my inportb and other stuff has some GAS AT&T syntax that it needs. How?
Thanks.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:GAS intel syntax
pop... i think the changes in my upper post will interrest you
i didn't tested it by myself, anyway
i didn't tested it by myself, anyway
Re:GAS intel syntax
Look what I made:
#define inasm(s) asm( ".intel_syntax" ); asm(s);asm(".att_syntax" ); // my version of GAS does not support no_prefix.
Inorder to use intel syntax with new versions of GAS with GCC, you NEED this:
#define inasm(s) asm( ".intel_syntax no_prefix" ); asm(s);asm(".att_syntax prefix" );
Example:
[main]()
{
inasm( "mov eax, 1\n
mov eax, 2\n" );
}
#define inasm(s) asm( ".intel_syntax" ); asm(s);asm(".att_syntax" ); // my version of GAS does not support no_prefix.
Inorder to use intel syntax with new versions of GAS with GCC, you NEED this:
#define inasm(s) asm( ".intel_syntax no_prefix" ); asm(s);asm(".att_syntax prefix" );
Example:
[main]()
{
inasm( "mov eax, 1\n
mov eax, 2\n" );
}