#define SWAP_ENDIAN(x)            ( ((x>>24)&0xFF) | ((x>>8)&0xFF00) | ((x<<8)&0xFF0000) | (x<<24) )

解决方案 »

  1.   

    好像是big-endian和small-endian的互换。
    我看名字猜的
      

  2.   

    old x:0-7      8-15    16-23    24-31
    new x:24-31    16-23   8 - 15   0 - 7 将32位数据分成 高16位和低16位
    高16位的高8位与低16位的低8位交换
    高16位的低8位与低16位的高8位交换这个宏定义的不错哦
      

  3.   

    就是我在上面说的big-endian和small-endian的转换。
    Intel的cpu是small-endian。motorola的cpu是big-endian的。
    大家学习asm的时候都学过了吧。
    这个Macro写得好。我收藏!