[Gambas-user] big-endian / little-endian conversion

Ru Vuott vuott at ...325...
Sat Aug 3 18:14:29 CEST 2013


Hello,

I was trying a big-endian / little-endian conversion.

In web I found this C function:

   ((word>>8) & 0x00FF) | ((word<<8) & 0xFF00)

 word is a  " 16bit "  value.


Well,

I translated that function in Gambas:

    Print Hex((Shr(&2301, 8) And &00FF) Or (Shl(&2301, 8) And &FF00))

I was waiting for this value:   01 23

but I do not understand why I obtain this results:  23 01 23


Where do I make the mistake ?

Thanks

vuott




More information about the User mailing list