This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Gnu assembler question for ARM
- From: Ciaccia <ciacciax at yahoo dot com>
- To: Paul Brook <paul at codesourcery dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 4 May 2007 01:32:13 -0700 (PDT)
- Subject: Re: Gnu assembler question for ARM
Ok Paul,
thanks a lot. I was using binutils-2.16.1, therefore it was not working... Now I switched to the 2.17 and everything is fine ;-)
Just another question, it's really tough to find good examples on-line for gas...
Let's assume my function gets a pointer to a "C"-struct and wants to use its fields. Currently my code references the fields by hard-coding the offsets in the code, which makes the code not very readable and error prone. What is the best way to use records in assembler? I don't want to define them or allocate them in assembler, just access their fields when I receive a reference to them.
Thanks again for the help
Andrea
----- Original Message ----
From: Paul Brook <paul@codesourcery.com>
To: Ciaccia <ciacciax@yahoo.com>
Cc: drow@false.org; binutils@sourceware.org
Sent: Thursday, May 3, 2007 8:25:04 PM
Subject: Re: Gnu assembler question for ARM
> > What did you try? IIRC you want something like "[pc, . - .Label + 8]".
> > cfldrs c1, myvar
> >
> > Should do the trick.
>
> Anyway, when I try to load integers (using the standard ldr) the following
> 2 options are ok:
>
> ldr r0, [pc, #myint - . - 8]
> and
> ldr r0, myint
> mov pc, lr
>
> With the maverickcrunck specific opcodes, only this one works:
>
> cfldrs c0, [pc, #-12]
Sounds like your binutils is broken.
I tested current CVS and it worked (you also need to use mvf0, not c0).
Paul
____________________________________________________________________________________
Now that's room service! Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097