This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Why does _at_ destroy my pointers

some background code to look at

structure:

typedef struct tMyStruct
{
        DWORD s1;
        BYTE  s2;
} MY_STRUCT;

I have an external variable defined using this structure, Note that it is an array

extern MY_STRUCT xdata Var1[];

and here is the declaration

xdata volatile MY_STRUCT Var1[500];

I use a pointer array of the type MY_STRUCT to access and modify data within the Var1 Array

xdata MY_STRUCT *pVar1[4];

This code works just fine. I have the need now, to Force Var1 to be located at a specific address so I can overlay some other variables (that won't be used at the same time). I read up on using _at_ and declaring space for variables in assembly. and before I started overlaying I changed the declaration of Var1 to this:

xdata volatile MY_STRUCT Var1[500] _at_ (0x100);

The code compiles and runs but does not work properly. for some reason the pointers do not behave as before. If someone could tell me why I shouldn't be able to do this or how to fix it it would be great.

0