I hope it's ok to resume a thread after it has sat for a few days. Scott, you suggested ("paraphrasing" slightly): union lo_hi { unsigned int i; struct { unsigned char l; unsigned char h; } b; }; typedef union lo_hi lo_hi; #define LO_BYTE(x) ( ((lo_hi)(x)).b.l) #define HI_BYTE(x) ( ((lo_hi)(x)).b.h) unsigned int eth_length; // int is 16 bits LO_BYTE(eth_length) = ....; HI_BYTE(eth_length) = ....; vs. union lo_hi {unsigned int16 base; unsigned int8 lh[2];}; #define lo lh[0] #define hi lh[1] union lo_hi eth_length; eth_length.lo = ....; eth_length.hi = ....; The main advantage I see in what you suggested is that eth_length can be referred to 'normally'; in what I did, I have to use "eth_length.base" to refer to the whole variable. Unfortunately, I can't get CCS to compile your example. If I understand it correctly, the key element is typecasting the 16 bit integer to a union. So, if I write it all out without the macros or the typedef, the resulting statement is: (((union lo_hi) eth_length).b.l) = ....; // assign low byte CCS won't compile this statement - it says it is looking for a close paren. I didn't know you could cast to a union or a structure, and the limited references I have handy don't talk about it. Am I understanding your suggestion correctly? Someone suggested always having a copy of K&R - I will be picking one up! By the way, CCS also complained about the typedef having the same names. Sorry for the long post - if you got this far, thanks for taking the time to read it. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu