Pointer stored in wrong code class.

Can anyone tell me why the following code for the C167 will place the pointer in either the NDATA0 class or the XDATA0 class depending on which line is uncommented?

typedef struct
{
short type;
} DIR_ENTRY;

typedef DIR_ENTRY xhuge * DIR_PTR;


//DIR_PTR test1; // Pointer placed in the XDATA0 class.
DIR_ENTRY xhuge * test1; // Pointer placed in the NDATA0 class.

I am using version 4.06 of the compiler.

Thanks.

Parents
  • DIR_ENTRY xhuge *DIR_PTR;
    This means, DIR_PTR's will be in the default memory space and they will only point to the xhuge memory space.

    typedef DIR_ENTRY xhuge * xhuge DIR_PTR;

    This means, put DIR_PTR's in the xhuge memory space and they only point to xhuge memory space.

    - Mark

Reply
  • DIR_ENTRY xhuge *DIR_PTR;
    This means, DIR_PTR's will be in the default memory space and they will only point to the xhuge memory space.

    typedef DIR_ENTRY xhuge * xhuge DIR_PTR;

    This means, put DIR_PTR's in the xhuge memory space and they only point to xhuge memory space.

    - Mark

Children
More questions in this forum