When you offered to write Intel versions of the AT&T code I looked for a
way to automate some of the translation process. So I tried using the
-masm=intel and -S compiler options to translate the inline assembly
code and write it to an .s file. The inlined instructions were simply
copied. So it is unlikely gcc can handle VC like __asm statements, where
the compiler definitely needs to understand assembly code. The MSDN does
say the VC compiler has a built in assembler. gcc compilers only
generates assembly output for the next stage in the compilation process.
So I tried compiling a simple assembly code example in MSDN which calls
printf, and gcc C did not recognize the __asm keyword. Finally, I just
found a mingw-users thread* where Thomas Heller of ctypes fame was
looking for a inline assembly formated recognized by both gcc and VC. No
luck. The advice was to use assembly files and a free assembler like
NASM or as. Not helpful when distutils doe not directly support
assembler files. This is not promising.
Lenard
*
http://sourceforge.net/mailarchive/message.php?msg_id=20060602080833.005cjbdekmyo4c4w%40mail.progw.org
Richard Goedeken wrote:
Hey, that's great! Are you sure that this switch allows one to write
inline asm in Intel format? The man page says:
-masm=dialect
Output asm instructions using selected dialect. Supported
choices are intel or att (the default one). Darwin does not support
intel.
I'll give a try some time.
Richard
René Dudfield wrote:
hello,
for your info...
gcc supports intel syntax with a command line option.
-masm=intel
SDL uses macros for portable asm, I think.