Bob Ammerman wrote: > I think Peter's response to this will get you going. However, it is worth > noting that a shift is likely to be _much_ faster than a multiply (unless= of > course the compiler is smart enough to see that this multiply can be > implemented by a shift): > =20 I would hope the compiler for an 8-bit microcontroller would be smart=20 enough to turn either shifts or multiplys into byte copies. Interestingly C18 will sometimes turn a shift into a multiply. The PIC18=20 is actually better at multiplication than it is at shifting since it has=20 a multiplier but not a barrel shifter. >> greentemp =3D green << 16; >> redtemp =3D red << 8; >> bluetemp =3D blue; >> =20 You mean greentemp =3D (uint32_t)green << 16; redtemp =3D (uint32_t)red << 8; bluetemp =3D blue; --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .