Size of Pointer to Constant Table

I would like to know how can we control the size of the pointer that point to RAM area.

UByte *RamAdr;
For code above, I found that the pointer size is different in 2 different software (1 software use 2Bytes to reference RAM area while the other one use 3Bytes

How to control size of Pointer to RAM area

Parents
  • hi,

    to control the size of pointer you should define the type of area which pointer shows on.

    For example:

    unsigned char idata *RamAdr; //uses one byte for pointer (due MOV @Ri)
    unsigned char xdata *RamAdr; // uses two bytes (MOVX @DPTR)
    unsigned char *RamAdr; // uses three bytes
    Last example is your case. Here, the third byte is used to indicate type of memory area where data are placed in real application.

    Regards,
    Oleg

Reply
  • hi,

    to control the size of pointer you should define the type of area which pointer shows on.

    For example:

    unsigned char idata *RamAdr; //uses one byte for pointer (due MOV @Ri)
    unsigned char xdata *RamAdr; // uses two bytes (MOVX @DPTR)
    unsigned char *RamAdr; // uses three bytes
    Last example is your case. Here, the third byte is used to indicate type of memory area where data are placed in real application.

    Regards,
    Oleg

Children
More questions in this forum