Mailing List Archive

ASM resources?
All,

I was looking around for some nice asm resource, particularly around
the areas of :

sparc asm
ppc asm (JoseX already gave me a nice one and eklipse gave me one too,
any more would be great)
amd64 asm (anything extended beyond the usual x86 instruction sets)

Also, if anyone knows a nice info page/website for gcc inline assembly
that would be good too :). Thanks ahead of time for anyone here that
has some 2 cents to throw in. I'm hoping to use this to better rev up
some skills and get on those hard to touch media-video/anything asm bugs
(You gotta love those :).

--
Chris White <chriswhite@gentoo.org>
------------------------
Sound | Video | Security
Mozilla | Haskell | Lang-misc
ChrisWhite @ irc.freenode.net
Re: ASM resources? [ In reply to ]
On Wed, Oct 27, 2004 at 05:51:43AM +0900, Chris White wrote:
> sparc asm
> ppc asm (JoseX already gave me a nice one and eklipse gave me one too,
> any more would be great)
> amd64 asm (anything extended beyond the usual x86 instruction sets)
>
> Also, if anyone knows a nice info page/website for gcc inline assembly
> that would be good too :). Thanks ahead of time for anyone here that
> has some 2 cents to throw in. I'm hoping to use this to better rev up
> some skills and get on those hard to touch media-video/anything asm bugs
> (You gotta love those :).
If you find anything on how to write ASM code that works properly with
-fPIC, please tell me! I've got a MySQL bug hung up on that point, and I
haven't succeeded in finding out how to do such a thing.

For GCC Inline ASM,
I recommend:
http://www-106.ibm.com/developerworks/library/l-ia.html
http://www.delorie.com/djgpp/doc/brennan/brennan_att_inline_djgpp.html

To round out your collection:
- For MIPS assembler - find the book: 'See MIPS Run' by Dominic Sweetman
- For ARM assembler - visit this webpage:
http://www.arm.com/documentation/cd_request.html
Fill it out, and wait a few weeks for a free CD with all the docs
you'll ever need.

I'd be interested in the results of your research into various variants
of assembly as well, if you'd care to post up a summary once you've got
them all together.

--
Robin Hugh Johnson
E-Mail : robbat2@orbis-terrarum.net
Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ# : 30269588 or 41961639
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
Re: ASM resources? [ In reply to ]
On Wed, 27 Oct 2004 05:51:43 +0900 Chris White <chriswhite@gentoo.org>
wrote:
| I was looking around for some nice asm resource, particularly
| around
| the areas of :
|
| sparc asm

Buy / download a copy of the sparc v9 book. You can get it from Sun or
wesolows' ftp server.

--
Ciaran McCreesh : Gentoo Developer (Vim, Fluxbox, Sparc, Mips)
Mail : ciaranm at gentoo.org
Web : http://dev.gentoo.org/~ciaranm
Re: ASM resources? [ In reply to ]
hi,

some introductory links to sparc and ppc inline asm:

http://www.cs.unm.edu/~maccabe/classes/341/labman/labman.html
http://www-106.ibm.com/developerworks/linux/library/l-ppc/

for gcc inline assembly, here are couple of useful links:

http://osdev.neopages.net/tutorials/gccasmtut.php?the_id=68
http://www-106.ibm.com/developerworks/linux/library/l-ia.html
http://linuxassembly.org/articles/linasm.html

i am sure you can find many more on the net.

hth

kind regards
anupam

On Wed, 27 Oct 2004 05:51:43 +0900, Chris White <chriswhite@gentoo.org> wrote:
> All,
>
> I was looking around for some nice asm resource, particularly around
> the areas of :
>
> sparc asm
> ppc asm (JoseX already gave me a nice one and eklipse gave me one too,
> any more would be great)
> amd64 asm (anything extended beyond the usual x86 instruction sets)
>
> Also, if anyone knows a nice info page/website for gcc inline assembly
> that would be good too :). Thanks ahead of time for anyone here that
> has some 2 cents to throw in. I'm hoping to use this to better rev up
> some skills and get on those hard to touch media-video/anything asm bugs
> (You gotta love those :).
>
> --
> Chris White <chriswhite@gentoo.org>
> ------------------------
> Sound | Video | Security
> Mozilla | Haskell | Lang-misc
> ChrisWhite @ irc.freenode.net
>
>
>


--
if you need gmail invites, let me know !

--
gentoo-dev@gentoo.org mailing list
Re: ASM resources? [ In reply to ]
Robin H. Johnson wrote:
>
> If you find anything on how to write ASM code that works properly with
> -fPIC, please tell me! I've got a MySQL bug hung up on that point, and I
> haven't succeeded in finding out how to do such a thing.
>
I remember that with -fPIC you lose a register, you may try to use
-fomit-frame-pointer to get one back or rewrite your inline asm to use
one register less (quite painfull I think ^^)


lu

--
Luca Barbato
Developer
Gentoo Linux http://www.gentoo.org/~lu_zero



--
gentoo-dev@gentoo.org mailing list
Re: ASM resources? [ In reply to ]
On Wed, Oct 27, 2004 at 09:43:23AM +0200, Luca Barbato wrote:
> Robin H. Johnson wrote:
> >If you find anything on how to write ASM code that works properly with
> >-fPIC, please tell me! I've got a MySQL bug hung up on that point, and I
> >haven't succeeded in finding out how to do such a thing.
> I remember that with -fPIC you lose a register, you may try to use
> -fomit-frame-pointer to get one back or rewrite your inline asm to use
> one register less (quite painfull I think ^^)
That's totally not the problem, see bug 42968.

--
Robin Hugh Johnson
E-Mail : robbat2@orbis-terrarum.net
Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
ICQ# : 30269588 or 41961639
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
Re: ASM resources? [ In reply to ]
On Wed, 27 Oct 2004 01:08:08 -0700, Robin H. Johnson <robbat2@gentoo.org> wrote:
> On Wed, Oct 27, 2004 at 09:43:23AM +0200, Luca Barbato wrote:
> > Robin H. Johnson wrote:
> > >If you find anything on how to write ASM code that works properly with
> > >-fPIC, please tell me! I've got a MySQL bug hung up on that point, and I
> > >haven't succeeded in finding out how to do such a thing.
> > I remember that with -fPIC you lose a register, you may try to use
> > -fomit-frame-pointer to get one back or rewrite your inline asm to use
> > one register less (quite painfull I think ^^)
> That's totally not the problem, see bug 42968.

afaik, the only way to do this is to use the GOT(global offset table)
to get the address of global symbols. once you have the address of the
GOT, you can then load the addresses of your variables from there e.g.

lea eax, [ebx + foo wrt ..gotoff]

to load the address of "foo" into eax.

this is all nasm speak. you can find more information regarding shared
libs + asm in section 8 of the wonderful info pages.

kind regards
anupam

--
if you need gmail invites, let me know !

--
gentoo-dev@gentoo.org mailing list
Re: ASM resources? [ In reply to ]
On Wed, 27 Oct 2004 01:08:08 -0700, Robin H. Johnson <robbat2@gentoo.org> wrote:
> On Wed, Oct 27, 2004 at 09:43:23AM +0200, Luca Barbato wrote:
> > Robin H. Johnson wrote:
> > >If you find anything on how to write ASM code that works properly with
> > >-fPIC, please tell me! I've got a MySQL bug hung up on that point, and I
> > >haven't succeeded in finding out how to do such a thing.
> > I remember that with -fPIC you lose a register, you may try to use
> > -fomit-frame-pointer to get one back or rewrite your inline asm to use
> > one register less (quite painfull I think ^^)
> That's totally not the problem, see bug 42968.

afaik, the only way to do this is to use the GOT(global offset table)
to get the address of global symbols. once you have the address of the
GOT, you can then load the addresses of your variables from there e.g.

lea eax, [ebx + foo wrt ..gotoff]

to load the address of "foo" into eax.

this is all nasm speak. you can find more information regarding shared
libs + asm in section 8 of the wonderful info pages.

kind regards
anupam

--
if you need gmail invites, let me know !

--
gentoo-dev@gentoo.org mailing list