keasley keasley

Byte align base address of class - CW6.4 on 5282

Discussion created by keasley keasley on Aug 16, 2007
Latest reply on Aug 27, 2007 by Dumitru Negrea
CW6.4 on 5282

I have byte - aligned a class and placed it (nearly) at my desired memory location; however, I need it to start at a byte address, and it always increments to the next 2-byte address. How do I get "Instance" the be a 0x7000000f ?  My .lcf, .cpp, and .xMAP file entries are below. Thank you.

MEMORY {
    TEXT (RX) : ORIGIN = 0x00000500, LENGTH = 0    # using External DRAM
    DATA   (RW) : ORIGIN = AFTER(TEXT), LENGTH = 0
    myIOSpace (RW) : ORIGIN = 0x7000000f
}
SECTIONS {
...
    .mySection :
    {
      *(.Space1)
    } > myIOSpace
...

---------------------------------------------------------
class myClass
{
public:
  unsigned char yyy;
  unsigned char zzz;
  myClass(void)
  {
    yyy = 3;
    zzz = 4;
  }
};
---------------------------------------------------------
#pragma define_section mySpace ".Space1" far_absolute
__declspec(mySpace) myClass Instance;

int main()
{
  while(1);
}
---------------------------------------------------------
# .mySection
  70000010 00000002 .Space1 Instance    (main.c)

Outcomes