Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Analog Devices DSPs | Creating absolute symbols

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

Creating absolute symbols - Kenneth Porter - Aug 19 6:37:00 1999

How can I create a label at an absolute location? I have some legacy
code for another CPU that expects an ASM file to org to a location and
declare a symbol:

org 1234
_symbol DW ? ; declare a word at this location
public _symbol

The symbol represents a logical location of a parameter in non-volatile
storage.

Elsewhere, C code uses this symbol with

extern dword symbol;
value = get_nonvolatile(&symbol);

How might I accomplish this with the SHARC tools?

The ASM file uses conditional compilation to control the layout of
storage, so I can't simply change the C files or declare the symbols in
headers.

Kenneth Porter
Kensington Laboratories, Inc.
mailto:
http://www.kensingtonlabs.com



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: Creating absolute symbols - Michael Haertl - Aug 19 10:04:00 1999

hello,

On Wed, 18 Aug 1999, Kenneth Porter wrote:

> How can I create a label at an absolute location? I have some legacy
> code for another CPU that expects an ASM file to org to a location and
> declare a symbol:
>
> org 1234
> _symbol DW ? ; declare a word at this location
> public _symbol

> Elsewhere, C code uses this symbol with
>
> extern dword symbol;
> value = get_nonvolatile(&symbol);

> How might I accomplish this with the SHARC tools?
>
> The ASM file uses conditional compilation to control the layout of
> storage, so I can't simply change the C files or declare the symbols in
> headers.

if you conditionally include the headers ? nevertheless, i am not sure if i get it completely, but the following
might help:

for absolute placement of variables you can declare a separate segment in
the architecture file (linker description file) and place the variable
within this segment. for conditional compilation this does not help, of
course.

furthermore you can read/write absolutely from/to memory:
value = *((unsigned*) _absolute_adress_ ); // read
*((unsigned*) _absolute_adress_ ) = value; // write

when you conditionally define the value of _absolute_adress_, then it
could do what you need. but take care where you read/write from/to the
memory at _absolute_adress_. it needs not to be declared in the
architecture file. you can manipulate all existent (and nonexistent)
memory with the above lines (your IOP regs as well).

Michael

--
Michael Haertl



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Creating absolute symbols - Kenneth Porter - Aug 19 22:14:00 1999

On Thu, 19 Aug 1999 12:04:06 +0200 (MET DST), Michael Haertl wrote:

> if you conditionally include the headers ?

Alas, the conditionals used with the client routines don't match those
used with the declarations for the storage layout. Legacy code, you
know.

> for absolute placement of variables you can declare a separate segment in
> the architecture file (linker description file) and place the variable
> within this segment. for conditional compilation this does not help, of
> course.

I thought I might be able to use the Port stuff in the LDF, but I
haven't found an example, so I'm not sure if that does what I want. I'm
figuring on using the C preprocessor to expand conditionals in my
existing file and create LDF Port declarations that can be included in
the main LDF file.

> furthermore you can read/write absolutely from/to memory:
> value = *((unsigned*) _absolute_adress_ ); // read
> *((unsigned*) _absolute_adress_ ) = value; // write

Today, that's how I'd write it. Hindsight is wonderful, isn't it? ;-)

Kenneth Porter
Kensington Laboratories, Inc.
mailto:
http://www.kensingtonlabs.com


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )