Why can't nasm replace gas, in *bsd or linux?
Why can't nasm replace gas, in *bsd or linux?
In my opinion, assembly language is essentially mnemonics,
so it will not bring incompatibility problem, also, the clearer the better.
Is it true?
So could you tell me why gas is not out?
Because habit?
http://www.nasm.us/doc/nasmdoc1.html#section-1.1.1
so it will not bring incompatibility problem, also, the clearer the better.
Is it true?
So could you tell me why gas is not out?
Because habit?
http://www.nasm.us/doc/nasmdoc1.html#section-1.1.1
- AndrewAPrice
- Member
- Posts: 2299
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: Why can't nasm replace gas, in *bsd or linux?
GAS uses AT&T syntax, while NASM, FASM, and the majority of other assemblers use Intel syntax. The majority of OSS tools that use GAS (including GCC) are still relying on AT&T syntax.
GCC can generate Intel syntax though (and there's nothing really stopping you from replacing GAS with your own assembler), and also GAS also works with Intel syntax (not TRUE Intel syntax as I found out the hard way, but close to it).
GCC can generate Intel syntax though (and there's nothing really stopping you from replacing GAS with your own assembler), and also GAS also works with Intel syntax (not TRUE Intel syntax as I found out the hard way, but close to it).
My OS is Perception.
Re: Why can't nasm replace gas, in *bsd or linux?
Some people (like me) prefer the AT&T syntax. It feels "weird" to anyone who's learned Assembler from the usual suspects nowadays (Intel manuals, AoA etc.), but "natural" to dinosaurs like me.MessiahAndrw wrote:GAS uses AT&T syntax, while NASM, FASM, and the majority of other assemblers use Intel syntax.
Actually GCC doesn't feed GAS assembler source. The handover between GCC and GAS is done in form of a binary representation, which can be disassembled by the -S option.The majority of OSS tools that use GAS (including GCC) are still relying on AT&T syntax.
And there are more dependencies between GCC and the binutils package than just GAS, so I wouldn't bet on any other assembler replacing GAS in binutils...
Every good solution is obvious once you've found it.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Why can't nasm replace gas, in *bsd or linux?
There's still YASM which can assemble both proper intel syntax, as well as AT&T syntax. But as Solar pointed out, there are a lot of hidden dependencies between gcc an binutils forcing you pretty much use them together.
I won't bite the AT&T vs intel syntax troll.
I won't bite the AT&T vs intel syntax troll.
Re: Why can't nasm replace gas, in *bsd or linux?
[troll]
Intel for the win! Intel syntax is the form used by the official intel manuals and the form used by the opcode format itself.
backwards operands and random % and $ signs everywhere doesn't help readability either.
[/troll]
I think it'd be pretty nifty if pcc targeted the 8086 and such with yasm as it's backend assembler.. but many people would argue its an obsolete architecture to develop in C for.
Intel for the win! Intel syntax is the form used by the official intel manuals and the form used by the opcode format itself.
backwards operands and random % and $ signs everywhere doesn't help readability either.
[/troll]
I think it'd be pretty nifty if pcc targeted the 8086 and such with yasm as it's backend assembler.. but many people would argue its an obsolete architecture to develop in C for.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Why can't nasm replace gas, in *bsd or linux?
I hear it's not really maintained that well so it doesn't always produce optimal code and sometimes it can even produce wrong code. I'm not sure exactly why this is.MessiahAndrw wrote:GCC can generate Intel syntax though (and there's nothing really stopping you from replacing GAS with your own assembler), and also GAS also works with Intel syntax (not TRUE Intel syntax as I found out the hard way, but close to it).
Believe it or not, however official the Intel manuals might be, AT&T came up with the original assembly syntax (for the x86?). And the signs you're talking about aren't thar random, they are a safety feature (for separating registers from labels and so on). I'm sure AT&T fans have things they too find weird about the Intel syntax. I am an Intel fan, myself. I just thought I should mention this.earlz wrote:[troll]
Intel for the win! Intel syntax is the form used by the official intel manuals and the form used by the opcode format itself.
backwards operands and random % and $ signs everywhere doesn't help readability either.
[/troll]
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Why can't nasm replace gas, in *bsd or linux?
From the binutils / GAS manual:Love4Boobies wrote:I hear [GAS intel mode] is not really maintained that well so it doesn't always produce optimal code and sometimes it can even produce wrong code. I'm not sure exactly why this is.
as is primarily intended to assemble the output of the gnu C compiler gcc for use by the linker ld.
It's a compiler backend first, and a standalone assembler second.
Every good solution is obvious once you've found it.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Why can't nasm replace gas, in *bsd or linux?
I can understand that but they could, at least for the sake of inline assembly, do something about this whole mess...Solar wrote:It's a compiler backend first, and a standalone assembler second.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Why can't nasm replace gas, in *bsd or linux?
I just don't think they consider intel-style inline assembly - a highly implementation-specific construct of very limited usefulness in user space - to be that much of a priority, given that they still haven't nailed all of the language standards yet...
Every good solution is obvious once you've found it.
Re: Why can't nasm replace gas, in *bsd or linux?
probably because gas is the GNU assembler and gcc is the GNU compiler collection.
Notice the parallels....
Notice the parallels....
Re: Why can't nasm replace gas, in *bsd or linux?
Being a GCC and NASM fan, I would love GCC to produce NASM-style assembly output.
As far as I know, David Lindauer's CC386 is the only C compiler that produces NASM output. But with all due respect, CC386 is not half as good as GCC is.
Roel
As far as I know, David Lindauer's CC386 is the only C compiler that produces NASM output. But with all due respect, CC386 is not half as good as GCC is.
Roel