>Hi,
>
>I've been unable to find any documentation or examples showing how to
>convert big endian to little endian types, and vice versa.
>Specifically, I need functions to convert palm integers (16-bit) to and
>from desktop (Intel) integers (32-bits). It would also be beneficial to
>have a desktop routine to create Palm formatted dates.
// Typed in Eudora, never compiled.
UInt16 SwapEndian ( UInt16 inVal ) {
UInt8 hi, lo;
lo = inVal & 0x00FF;
hi = inVal >> 8;
return ( lo << 8 ) | hi;
}
If you want to use MSC-specific things, I would check the "_rotate" or maybe "_ror"
calls.
--
-- Marshall
Marshall Clow Idio Software <mailto:[EMAIL PROTECTED]>
It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/