another try which might work in lite-c:
Code:
long le2be(long le_32)
{
char b1 = le_32 >> 24, b2 = le_32 >> 16, b3 = le_32 >> 8, b4 = le_32;
return (((long)b4) << 24) |
(((long)b3) << 16) |
(((long)b2) << 8) |
(long)b1;
}
i still don't really know how the lite-c compiler treats signed integers. i wouldn't do that in standard c since there's no such thing as a reinterpret_cast. if the compiler tries to convert between the different variable types... dunno what'll happen then. how about:
Code:
xor edx, edx
mov eax, le_32
shr eax, 18h
or edx, eax
mov eax, le_32
shr eax, 08h
and eax, ff00h
or edx, eax
mov eax, le_32
shl eax, 08h
and eax, ff0000h
or edx, eax
mov eax, le_32
shl eax, 18h
or edx, eax
mov le_32, edx