Anyone use GAS instead of NASM?
Anyone use GAS instead of NASM?
Anyone out there developing or developed an OS using GNU GAS and C instead of NASM? Most of my assembly reference books cover GAS and not NASM, so im a little inclined to use that (and AT&T syntax) over NASM.
If anyone wrote their bootloader or OS in GAS, let me know if your source code is available out there somewhere. I've been looking up tutorials for the bootloader and OS dev but most cover NASM development only. Thanks in advance.
If anyone wrote their bootloader or OS in GAS, let me know if your source code is available out there somewhere. I've been looking up tutorials for the bootloader and OS dev but most cover NASM development only. Thanks in advance.
My os is programmed in GAS and C++, if that counts. I don't have any low level code in GAS, though, except for the multiboot stuff.
The cake is a lie | rackbits.com
Yeah, mine uses GAS.
As mentioned above, you simply have to put the following to enable Intel syntax.
.intel_syntax <- enables usage of generic mneumonics like mov instead of movl
noprefix <- enables use of registers and other constants without the prefixes like $(..), %, etc.
All you have to do is place at the start of your .S files.[/code]
As mentioned above, you simply have to put the following to enable Intel syntax.
Code: Select all
.intel_syntax noprefix
noprefix <- enables use of registers and other constants without the prefixes like $(..), %, etc.
All you have to do is place at the start of your .S files.[/code]
I don't see the advantage of intel syntax if you're using GAS. It's not like AT&T style is any worse. Actually I found (with only one exception) AT&T style to be nicer than intel style.
The cake is a lie | rackbits.com
-
thegreatseph
- Posts: 12
- Joined: Wed Dec 19, 2007 6:40 pm
The "advantage" is that if you are someone like me who used TASM and Turbo Pascal's inline assembly for years it can be very frustrating to move to another syntax. Familiarity is very important to most programmers...ucosty wrote:I don't see the advantage of intel syntax if you're using GAS. It's not like AT&T style is any worse. Actually I found (with only one exception) AT&T style to be nicer than intel style.
-
Craze Frog
- Member

- Posts: 368
- Joined: Sun Sep 23, 2007 4:52 am
It's a lot more typing! And the assigments are wrong:Actually I found (with only one exception) AT&T style to be nicer than intel style.
Code: Select all
C/Pascal/Basic/Everything except AT&T syntax:
eax = 5
Intel syntax:
mov eax, 5
AT&T syntax:
mov $5, %eax
It is up to personal choice.Also, the AT&T syntax requires a shift+number combo and a altGr+number combo, which makes it more uncomfortable to type. How can it be nicer?
Reflect Desktop Operating System - ' You only remember the name of the OS when it crashes '
i think it makes sense when you think of it like thisIt's a lot more typing! And the assigments are wrong
move $5 to %eax
because i read left to right so
Code: Select all
mov eax, 5
-><-<-
- Brynet-Inc
- Member

- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Don't blame a language because your keyboard layout is "inconvenient".Craze Frog wrote:Also, the AT&T syntax requires a shift+number combo and a altGr+number combo, which makes it more uncomfortable to type. How can it be nicer?
Languages like C and AT&T syntax flow nicely on EN-us/EN-ca keyboard layouts...
...which results in the source carrying much more information, making it easier to read (in my opinion). I tend to read code much more often than writing it.Craze Frog wrote:It's a lot more typing!
The opcode is called "mov(e)". I move something from somewhere to somewhere. So I'd say the opcode is chosen badly. If it were called "@$$(ign)" or something like that, I'd be at peace with it.And the assigments are wrong...
So do C/C++, Java, C# and a number of others...Also, the AT&T syntax requires a shift+number combo and a altGr+number combo...
Every good solution is obvious once you've found it.


