Does anyone know if GCC defines anything when in Intel or ATT mode?
I've tried searching online and have been unsuccessful.
Thanks to Jonas Quinn, I know about the .att_syntax and .intel_syntax inline assembly instructions, but I have no way of knowing what the default was.
GCC Assembly
Moderator: ZSNES Mods
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
GCC Assembly
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
From the GCC 3.3.6 manpage:
Code: Select all
-masm=dialect
Output asm instructions using selected dialect. Supported choices
are intel or att (the default one).
皆黙って俺について来い!!
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
I think that is for generating listings, but Nach is asking about the compiler's mode for *parsing* inline assembly. It sounds like he can force it to one mode or the other with .att_syntax or .intel_syntax, but he is looking for a way to detect the original state first, so he can set it back after the inline assembly.grinvader wrote:From the GCC 3.3.6 manpage:Code: Select all
-masm=dialect Output asm instructions using selected dialect. Supported choices are intel or att (the default one).
I don't know the answer unfortunately. You might be able to find out using the -dM option:
Code: Select all
-dCHARS
CHARS is a sequence of one or more of the following characters, and must not be preceded by a space. Other characters are interpreted by the compiler proper, or reserved for future versions of GCC, and so are silently ignored. If you specify characters whose behavior conflicts, the result is undefined.
M
Instead of the normal output, generate a list of #define directives for all the macros defined during the execution of the preprocessor, including predefined macros. This gives you a way of finding out what is predefined in your version of the preprocessor. Assuming you have no file foo.h, the command
touch foo.h; cpp -dM foo.h
will show all the predefined macros.
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
Personally, if I make a compiler that outputs AT&T asm natively, I'll make it eat inline AT&T asm natively.
LOGIC
LOGIC
皆黙って俺について来い!!
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
mozz is correct.
However the -dM option doesn't seem to specify anything special for intel or att mode.
And as far as I know there is no .original_syntax option :/
However the -dM option doesn't seem to specify anything special for intel or att mode.
And as far as I know there is no .original_syntax option :/
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
These [three] pages both imply that .att_syntax is the default. Maybe you could safely assume that to be the case.
http://gcc.gnu.org/ml/gcc/2003-07/msg01390.html
http://www.ugcs.caltech.edu/info/binutils/c-i386_1.html
http://www.cygwin.com/ml/binutils/2000-10/msg00268.html
http://gcc.gnu.org/ml/gcc/2003-07/msg01390.html
http://www.ugcs.caltech.edu/info/binutils/c-i386_1.html
http://www.cygwin.com/ml/binutils/2000-10/msg00268.html
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
.att_syntax is the default, but I can't assume that's the case because someone can use -masm=intel.
I think I can chalk this up as another one of GCCs major assembly weaknesses.
I think I can chalk this up as another one of GCCs major assembly weaknesses.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding