flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > How to produce assembly output in Intel syntax with GCC? |
Author |
|
LocoDelAssembly 20 Nov 2008, 22:05
I'm so exited in finding this that I couldn't resist to post this link: http://stackoverflow.com/questions/199966/how-do-you-use-gcc-to-generate-assembly-code-in-intel-syntax
Example that worked for me: gcc main.c -S -O3 -masm=intel Google, Thanks! |
|||
20 Nov 2008, 22:05 |
|
DOS386 21 Nov 2008, 01:59
Quote: worked for me: gcc main.c -S -O3 -masm=intel COOL: http://board.flatassembler.net/topic.php?p=84571#84571 What was in "main.c" ? How many lines ? Anyway, I had tested (using CC1.EXE from MINGW, on DOS, no DGJ-PP, of course ) in the meantime: - Seems to work somewhat - Syntax is mostly fixed, not fully, still strange directives and MA$M (or rather TASM ideal ?) instructions ... too much of PTR and OFFSET for my taste ... OTOH no ASSUME or PROTON encountered yet. Maybe some simple S&K (Search&Kick) process could fix it finally. - I've seen complaints about "ma$m=intel" being "broken" in GCC ... very valuable bug report - Tested also the O-hack: compiler is very stupid by default, but seems to be incredibly smart with -O3 : detects constant "variables" as well as unused variables, rearranges calculations, ... the problem is that is brews very broken code in some cases Of course there have been many complaints about "-O2 and above is broken" or "-O3 and above is broken" around ... so is this a known and acceptable issue of "high quality compiler" that -O2 and above is an experimental kamikaze hack producing broken results ? The compiler doesn't warn at all |
|||
21 Nov 2008, 01:59 |
|
LocoDelAssembly 21 Nov 2008, 17:49
Quote:
Not much, I've just done that to verify that what I wrote is what I wanted since it is safer than re-reading the documentation and believe you understood it correctly I've used O3 because it was much clearer to read than the default setting. |
|||
21 Nov 2008, 17:49 |
|
revolution 21 Nov 2008, 17:57
Actually I am surprised you didn't preiously know that. Even I've known that for a long time and I don't even code in C. I'm not trying to boast here, just genuinely shocked . Quite a few other compilers can also generate Intel syntax.
|
|||
21 Nov 2008, 17:57 |
|
LocoDelAssembly 21 Nov 2008, 18:31
Quote:
I know, I have posted an example generated with Visual C++ 2005 for you when you claimed that the compilers are stupid for not detect unneeded volatile specifiers when the problem to solve don't need them. The thing I didn't know was that GCC allowed to override the loved for no reason at all by Unix community AT&T syntax. |
|||
21 Nov 2008, 18:31 |
|
revolution 21 Nov 2008, 19:25
LocoDelAssembly wrote: ... the loved for no reason at all by Unix community AT&T syntax. |
|||
21 Nov 2008, 19:25 |
|
drhowarddrfine 23 Nov 2008, 04:15
I don't understand what makes it 'Unixy'. It's part of how the compiler works and isn't really for human consumption. Personally, I have no issues with ATT syntax.
|
|||
23 Nov 2008, 04:15 |
|
LocoDelAssembly 23 Nov 2008, 19:44
Quote:
Do you feel more comfortable with it than, say, fasm, nasm or similar Intel-like syntax? I see ATT syntax as the pleasure of the masochistic, what are the advantages of ATT over Intel syntax anyway? The official architecture manuals don't use this syntax so you even have to force your mind into permanent translation, it even disagrees with the placement of the dest and src operands. |
|||
23 Nov 2008, 19:44 |
|
mattst88 23 Nov 2008, 20:03
AT&T syntax is really just a relic of Bell Labs and UNIX.
It's not around because it's loved. It's still around because many people know it. |
|||
23 Nov 2008, 20:03 |
|
drhowarddrfine 24 Nov 2008, 00:07
LocoDelAssembly wrote:
Quote:
Quote: The official architecture manuals don't use this syntax so you even have to force your mind into permanent translation Quote: it even disagrees with the placement of the dest and src operands. |
|||
24 Nov 2008, 00:07 |
|
bitRAKE 24 Nov 2008, 05:47
drhowarddrfine wrote:
680x0 had me thinking that way for a while. AT&T being so drastically different helps with shifting the mindset, imho. If it looked closer to TASM/NASM/MASM/FASM then I'd just stare lost +15% of the time while trying to read it. EDIT by DOS386 : fixed broken quotes (is this like you tried to do ???) _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
24 Nov 2008, 05:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.