The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ToutEnMasm on May 31, 2006, 08:18:42 PM

Title: little endian big endian
Post by: ToutEnMasm on May 31, 2006, 08:18:42 PM
Hello,
How to convert a dword in big endian ?         a dword in little endian ?
                          Thanks for answer,toutEnmasm
Title: Re: little endian big endian
Post by: dsouza123 on May 31, 2006, 08:40:00 PM
bswap eax
Title: Re: little endian big endian
Post by: Tedd on June 01, 2006, 06:59:31 AM
or for processors that don't support bswap..

xcgh al,ah
rol eax,16
xcgh al,ah
Title: Re: little endian big endian
Post by: P1 on June 02, 2006, 05:56:00 PM
bswap for 486+

I don't know of any 386 or older systems running right now.

Regards,  P1  :8)
Title: Re: little endian big endian
Post by: savage on June 04, 2006, 06:53:50 PM
If my processor didn't support bswap, then I think by the time I typed:
Quote
xcgh al,ah
rol eax,16
xcgh al,ah

I could have upgraded to a 486+

...btw, shoulldn't that be xchg? =P