Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

big endian to little endian

blackmen
Beginner
522 Views
Hi all,

i am using Intel C Compiler for 32-bit applications, Version 9.0 for compiling c and c++ program ....

i am having binary file which is having big endian formatted data ......

how to convert this big endian to little endian format ?.....

Thanking you.
0 Kudos
3 Replies
Dale_S_Intel
Employee
522 Views

Is this by chance on a Mac?

Dale

0 Kudos
Dale_S_Intel
Employee
522 Views
If this is for a Mac, you should be using the 9.1 compiler, and I would refer you to http://developer.apple.com/documentation/MacOSX/Conceptual/universal_binary/
for more details on byte-swapping to account for endian-ness.
If not, perhaps you could provide a little more detail as to the problem you're trying to solve?
Thanks!
Dale
0 Kudos
levicki
Valued Contributor I
522 Views
By using bswap assembler instruction (i.e. bswap eax) or equivalent compiler intrinsic if available.

Note that there is no SIMD instruction for that purpose although it would be very usefull for sound card (wave) drivers.
0 Kudos
Reply