big endian VS little endian   8086机器都是使用little endian, 而摩托罗拉的power pc使用big endian,对于一个数0x1122产用little endian方式时   低字节存储0x22,高字节存储0x11. 而使用big endian方式时,  低字节存储0x11, 高字节存储0x22 在这俩种字节方式间转换可以使用汇编指令 BSWAP

测试函数

 int IsBigEndian()

{       

  unsigned short test = 1;       

       return (*((unsigned char  *)&test) == 0);

 }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-28
猜你喜欢
  • 2021-07-15
  • 2022-02-09
  • 2021-06-25
  • 2021-11-23
  • 2021-12-02
  • 2021-10-03
相关资源
相似解决方案