This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
efficient memory access from assembly
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Subject: efficient memory access from assembly
- From: "Jeger, Tobias" <tobias dot jeger at intersil dot com>
- Date: Tue, 20 Feb 2001 04:42:42 -0500
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