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

I do not need to be protected against myself

#define U16   unsigned short
#define U8DX  unsigned char   xdata * data

UCDX  GCDX232ptr;    // receive rs 232 pointer
U16 GStemp;
.....
  GStemp = (U16) GCDX232ptr;
  GStemp &= 0xFF00 ;
  GCDX232ptr = GStemp ;

works, why does

  (U16) GCDX232ptr &= 0xFF00 ;

not work

There should be a way. I am short of memory and need get rid of GStemp

Erik

Parents
  • that would work, I tried, however it makes the whole thing messy (the pointer is used as a pointer about 100 places and ANDed only once). I like "clean looking" code like the (U16) in the above example where the many places where the pointer is a pointer does not need multi.ptr but just ptr.

    More and more stuff get invented to make fast code more difficult because some want the compiler to protect them against themselves. That, of course alleviates the need for that awful thing called "thinking".

    Erik

Reply
  • that would work, I tried, however it makes the whole thing messy (the pointer is used as a pointer about 100 places and ANDed only once). I like "clean looking" code like the (U16) in the above example where the many places where the pointer is a pointer does not need multi.ptr but just ptr.

    More and more stuff get invented to make fast code more difficult because some want the compiler to protect them against themselves. That, of course alleviates the need for that awful thing called "thinking".

    Erik

Children
No data