instruction set to use with gnu assembler (as/gas) 
Author Message
 instruction set to use with gnu assembler (as/gas)

Hello,

is it that intel x386 instruction set and gas assembly instruction set
same?  I want to get gas assembly instruction set.  also I am using
att syntax.

could one provide links to them?

Thanks.




Tue, 09 Aug 2005 02:11:13 GMT  
 instruction set to use with gnu assembler (as/gas)
GAS and x86 are very different. GAS itself can assemble many different
instruction sets, one of which is x86. GAS uses the AT&T syntax.

If you are looking for the an x86 ISA (Instruction Set Architecture)
reference, get either the x86-64 docs (on the front page of www.amd.com) or
Intel's manuals. Get order 245271 (IA-32 Intel Architecture Software
Developer's Manual - Volume 2: Instruction Set Reference).

-Matt


Quote:
> Hello,

> is it that intel x386 instruction set and gas assembly instruction set
> same?  I want to get gas assembly instruction set.  also I am using
> att syntax.

> could one provide links to them?

> Thanks.





Tue, 09 Aug 2005 11:28:14 GMT  
 instruction set to use with gnu assembler (as/gas)

        What operating system are you using?

                                                - Lyle Goldman, U.S.A.

 >

Quote:
> Hello,

> is it that intel x386 instruction set and gas assembly instruction set
> same?  I want to get gas assembly instruction set.  also I am using
> att syntax.

> could one provide links to them?

> Thanks.





Tue, 09 Aug 2005 14:25:50 GMT  
 instruction set to use with gnu assembler (as/gas)

Quote:

>Hello,

>is it that intel x386 instruction set and gas assembly instruction set
>same?  I want to get gas assembly instruction set.  also I am using
>att syntax.

The basic instruction set is the same, although the syntax is VERY
different.  gas in AT&T mode requires a suffix on the instructions giving
the size of the operands, and of course the operands are in the opposite
order, so this in MASM:

        mov     eax, 3

becomes something like this in gas:

        movl    #3, %eax

The best references are by example.  If you have the Linux kernel source
code, look for the .s files.
--

  Providenza & Boekelheide, Inc.



Tue, 09 Aug 2005 13:57:29 GMT  
 instruction set to use with gnu assembler (as/gas)
As of GAS 2.13, configured for i386-pc-msdosdjgpp, you can assemble using
intel syntax by using the .intel_syntax directive in the .S file. You can
also assemble for pre-386 cpus using the .arch ARCHITECTURE directive, with
ARCHITECTURE being one of i8086, i186, i286, i386, i486, i586, i686,
pentium, pentiumpro, pentium4, k6, athlon or sledgehammer.


Quote:
> Hello,

> is it that intel x386 instruction set and gas assembly instruction set
> same?  I want to get gas assembly instruction set.  also I am using
> att syntax.

> could one provide links to them?

> Thanks.





Tue, 09 Aug 2005 19:25:37 GMT  
 instruction set to use with gnu assembler (as/gas)
I was wanting to use inline assembler with the djgpp compiler
but wasn't able to do so as I haven't been able to find out how
to use the funny %eax stuff.

Is there an inline directive I can use to get djgpp to compile
intel syntax?

John


Quote:
> As of GAS 2.13, configured for i386-pc-msdosdjgpp, you can assemble using
> intel syntax by using the .intel_syntax directive in the .S file. You can
> also assemble for pre-386 cpus using the .arch ARCHITECTURE directive,
with
> ARCHITECTURE being one of i8086, i186, i286, i386, i486, i586, i686,
> pentium, pentiumpro, pentium4, k6, athlon or sledgehammer.



> > Hello,

> > is it that intel x386 instruction set and gas assembly instruction set
> > same?  I want to get gas assembly instruction set.  also I am using
> > att syntax.

> > could one provide links to them?

> > Thanks.





Wed, 10 Aug 2005 06:58:22 GMT  
 instruction set to use with gnu assembler (as/gas)
There is a good tutorial on AT&T assembly by Brennan Underwood.
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html

The only things his tutorial does not mention that I have found useful:
%bn (where n is an integer) is the low byte of a GCC-picked register
%hn (where n is an integer) is the second byte of a GCC-picked register

"i" constraint allows any immediate (whereas "I" is 0 .. 31)
"ri" allows an immediate or register

-Matt


Quote:
> I was wanting to use inline assembler with the djgpp compiler
> but wasn't able to do so as I haven't been able to find out how
> to use the funny %eax stuff.

> Is there an inline directive I can use to get djgpp to compile
> intel syntax?

> John



> > As of GAS 2.13, configured for i386-pc-msdosdjgpp, you can assemble
using
> > intel syntax by using the .intel_syntax directive in the .S file. You
can
> > also assemble for pre-386 cpus using the .arch ARCHITECTURE directive,
> with
> > ARCHITECTURE being one of i8086, i186, i286, i386, i486, i586, i686,
> > pentium, pentiumpro, pentium4, k6, athlon or sledgehammer.



> > > Hello,

> > > is it that intel x386 instruction set and gas assembly instruction set
> > > same?  I want to get gas assembly instruction set.  also I am using
> > > att syntax.

> > > could one provide links to them?

> > > Thanks.





Wed, 10 Aug 2005 09:46:18 GMT  
 instruction set to use with gnu assembler (as/gas)

Quote:
> I was wanting to use inline assembler with the djgpp compiler
> but wasn't able to do so as I haven't been able to find out how
> to use the funny %eax stuff.

> Is there an inline directive I can use to get djgpp to compile
> intel syntax?

> John

Invoke GCC with -S -masm=intel.
The reason for the -S is that you need to manually insert the .intel_syntax
directive into the .S (gnu's aSm) file. Then, just compile the .S file.


Wed, 10 Aug 2005 09:35:55 GMT  
 instruction set to use with gnu assembler (as/gas)

Quote:

>    What operating system are you using?

>                                            - Lyle Goldman, U.S.A.

That's the second time today you've asked that of someone with a gas
question.  Why are you asking?  It's not really relevent.  Many people use
gas under cygwin on Windows.

Quote:

>> Hello,

>> is it that intel x386 instruction set and gas assembly instruction set
>> same?  I want to get gas assembly instruction set.  also I am using
>> att syntax.

>> could one provide links to them?

>> Thanks.



--

  Providenza & Boekelheide, Inc.


Thu, 11 Aug 2005 12:25:56 GMT  
 instruction set to use with gnu assembler (as/gas)
Further question:

I have The Intel Software Dev. Man. Vol II Instruction set reference - does
GAS know all of the stated instructions?

thx in advance


Quote:
> There is a good tutorial on AT&T assembly by Brennan Underwood.
> http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html

> The only things his tutorial does not mention that I have found useful:
> %bn (where n is an integer) is the low byte of a GCC-picked register
> %hn (where n is an integer) is the second byte of a GCC-picked register

> "i" constraint allows any immediate (whereas "I" is 0 .. 31)
> "ri" allows an immediate or register

> -Matt



> > I was wanting to use inline assembler with the djgpp compiler
> > but wasn't able to do so as I haven't been able to find out how
> > to use the funny %eax stuff.

> > Is there an inline directive I can use to get djgpp to compile
> > intel syntax?

> > John



> > > As of GAS 2.13, configured for i386-pc-msdosdjgpp, you can assemble
> using
> > > intel syntax by using the .intel_syntax directive in the .S file. You
> can
> > > also assemble for pre-386 cpus using the .arch ARCHITECTURE directive,
> > with
> > > ARCHITECTURE being one of i8086, i186, i286, i386, i486, i586, i686,
> > > pentium, pentiumpro, pentium4, k6, athlon or sledgehammer.



> > > > Hello,

> > > > is it that intel x386 instruction set and gas assembly instruction
set
> > > > same?  I want to get gas assembly instruction set.  also I am using
> > > > att syntax.

> > > > could one provide links to them?

> > > > Thanks.





Fri, 12 Aug 2005 07:06:53 GMT  
 instruction set to use with gnu assembler (as/gas)
I have written SSE in GAS. I presume so, but I can't claim to be certain.
With MMX and SSE instructions, you don't use a suffix like you do with
integer instructions.

-Matt


Quote:
> Further question:

> I have The Intel Software Dev. Man. Vol II Instruction set reference -
does
> GAS know all of the stated instructions?

> thx in advance



> > There is a good tutorial on AT&T assembly by Brennan Underwood.
> > http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html

> > The only things his tutorial does not mention that I have found useful:
> > %bn (where n is an integer) is the low byte of a GCC-picked register
> > %hn (where n is an integer) is the second byte of a GCC-picked register

> > "i" constraint allows any immediate (whereas "I" is 0 .. 31)
> > "ri" allows an immediate or register

> > -Matt



> > > I was wanting to use inline assembler with the djgpp compiler
> > > but wasn't able to do so as I haven't been able to find out how
> > > to use the funny %eax stuff.

> > > Is there an inline directive I can use to get djgpp to compile
> > > intel syntax?

> > > John



> > > > As of GAS 2.13, configured for i386-pc-msdosdjgpp, you can assemble
> > using
> > > > intel syntax by using the .intel_syntax directive in the .S file.
You
> > can
> > > > also assemble for pre-386 cpus using the .arch ARCHITECTURE
directive,
> > > with
> > > > ARCHITECTURE being one of i8086, i186, i286, i386, i486, i586, i686,
> > > > pentium, pentiumpro, pentium4, k6, athlon or sledgehammer.



> > > > > Hello,

> > > > > is it that intel x386 instruction set and gas assembly instruction
> set
> > > > > same?  I want to get gas assembly instruction set.  also I am
using
> > > > > att syntax.

> > > > > could one provide links to them?

> > > > > Thanks.





Fri, 12 Aug 2005 09:54:37 GMT  
 instruction set to use with gnu assembler (as/gas)

Quote:
> Further question:

> I have The Intel Software Dev. Man. Vol II Instruction set reference -
does
> GAS know all of the stated instructions?

GAS 2.13 (comes with GCC 3.2.1) for x86 understands up to at least P4. It
also understands x86-64 (though, you need to specify the .arch
sledgehammer).


Fri, 12 Aug 2005 13:27:48 GMT  
 
 [ 12 post ] 

 Relevant Pages 

1. GNU Binary Utilities 2.5.1 released: now includes assembler (gas)

2. GNU Binary Utilities 2.5.1 released: now includes assembler (gas)

3. programming in pascal 6.0 using assembler instructions

4. Using the GNU as assembler

5. real mode offsets using the GNU assembler!

6. Wanted instruction set for intel 80386/80486/8087/80487/pentium assembly set

7. gas (GNU)

8. Q: GNU gas technique...

9. GNU GAS

10. GNAT, Overloaded operators and a patch to GNU's gas 2.1.1

11. searching fot AT&T syntax, gas assembler

12. labels in gas and debugging using gdb

 

 
Powered by phpBB® Forum Software