At 04:51 PM 3/13/02 +0100, you wrote: >Now I have: > EEADR_L = (unsigned char) (i_eeprom & 0xFF); > EEADR_H = (unsigned char) (i_eeprom >> 8); >And I also define i_eeprom as 'unsigned int'. >EEADR_L and EEADR_H as 'unsigned char'. Incidentally, I get exactly the same number of words of code emitted with ANY of the suggested methods, when optimization is cranked up. Portability should be the first concern, and let the compiler worry about *how* to do it (unless it is a stupid compiler, then all bets are off) Unions look like they would produce faster code, but in fact they do not with a smart compiler. Similarly, the compiler should get rid of the (probably unneeded) and-ing with 0xFF above. It's important (not in this case, but in general) to remember that >> has implementation-defined behavior with signed numbers, according to the standard. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com 9/11 United we Stand -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads