From: Peter R. <pe...@ly...> - 2011-08-26 13:13:40
|
Den 2011-08-26 15:00 skrev Peter Rosin: > Den 2011-08-26 14:07 skrev max reason: >>> >>> Den 2011-08-26 11:36 skrev max reason: >>>> >>>> Thanks in advance for the information. >>> >>> Have you had a look at if giving the .intel_syntax directive to gas can >>> make you drop the AT&T syntax? But that path forward may not be available >>> for 64-bit? However, 3 is better than 4... >>> >>> http://sourceware.org/binutils/docs-2.21/as/i386_002dSyntax.html >>> >>> Cheers, >>> Peter >> >> ----- win32 versus linux32 >> >> That is very interesting. So let's see. Then I could have only ONE >> MASM format 32-bit assembly language file, and create two separate >> object files, one to link into my VisualStudio project on windoze, >> and another to link into my CodeBlocks/gcc project on linux? Cool! >> >> So, does this mean the assembler recognizes some kind of command >> line switch to specify win32 versus linux32 object file output? >> Or wait one second. I guess there must be separate executables >> that run on linux and windoze, right? Or... how does that work? > > I have not tried it myself, but there's an example on wikipedia. > > http://en.wikipedia.org/wiki/GNU_Assembler Let me clarify that, I meant that for linux32 you assemble using gas and have a .intel_syntax directive in the code (possibly inside an ifdef, to make it visible only to gas if masm barfs on it) which forces gas to parse it as if it was masm-style, and you get the elf object file you need. For win32 you assemble as usual with masm and get a coff object. Cheers, Peter |