This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

efficient memory access from assembly


Hi.

I am currently porting code (both C and assembler) from the ARM toolkit to the
GNU GCC environment. Reading through the documentstion of GCC, I can't figure
out how to port register relative memory access instructions without duplicating
information. So what I have is a (relocatable) area of data storage, where space
is allocated for a number of variables.
Having the base-address of this area in a register (say r5), I would like to be
able to perform accesses of the kind

	ldr	r1, [r5, #<variablename>]

so <variablename> must be the offset from the base-address. The location of the
code accessing the variables must be completely independent from the area where
the variables are stored at assembly-time, and the variables need to be
accessible to code in different files. Must this be done using {absolute}
addresses, which overlap at link-time, or does anybody have a better idea?

Tobi

Tobias S Jeger                              Rembrandtlaan 1a
Engineer for Embedded Software           3723BG Bilthoven NL 
Intersil Netherlands BV                   +31 (0)30 225 9756


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]