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

How to access high byte of 2-byte idata variable ?

I have one question about accessing high byte of 2-byte idata variable.

Case 1: for xdata variable we can use below to access the higher byte:

#define ADDR    *((_2BYTE xdata *) 0x0800)
  #define ADDRH   *((_1BYTE xdata *) 0x0800)
  #define ADDRL   *((_1BYTE xdata *) 0x0801)


If ADDRH is enough to make decision then we can just use ADDRH, instead of ADDR(2-byte)... This save code space...

Case 2: if ADDR is declared as "idata" then is there any way achieving the same goal like Case 1 ?

All we want to do is "save code base"...

Thanks in advance...

Parents Reply Children