Wade Hassler

Read-Only, I said!

Discussion created by Wade Hassler on Feb 25, 2011
Latest reply on Mar 1, 2011 by Wade Hassler

I have a program with the following two sets of data:

 

  // a list of ADDRESSES of BYTEs
#pragma INTO_ROM
  const  byte * These_Data[]={
&P12.b.high,          &P12.b.low,
&N12.b.high,          &N12.b.low, 
&HVDC.b.high,         &HVDC.b.low,
......
     };
#pragma INTO_ROM
// a list of LITERAL BYTEs
const byte These_Codes[] ={
P12_HB,         P12_LB,   
N12_HB,         N12_LB, 
HVDC_HB,        HVDC_LB,
......
     };

 The first is a list of addresses of data in SRAM... some words, some bytes, some longs, but all addressed as bytes

The second is a list of literal byte-values that will be sent along with the data found at the associated addresses.

No matter what I do, the LITERALS are compiled into ROM and the ADDRESSES end up in SRAM.

I'm not (yet) hurting for space, but it bugs me that data that is obviously (to me) invariant is always put in R/W memory.

What am I missing?

(9S12DX256, CW 5.90)

 

Thanks for any illumination

 

Wade Hassler

Outcomes