当前位置:网站首页>Size end byte order
Size end byte order
2022-06-27 12:43:00 【xiongsiyu979】
One 、 What is size side byte order
data-high : for example 16 Hexadecimal number 0x123456789,0x12 That is, the high-order data , relative ,0x89 Is the low order of data
High address space : For example, the following address 0x00000002 Is the upper address space , relative , Address 0x00000001 Is the lower address space

Small endian byte order (LSB): Store the high bits of data in the high address space
Big endian byte order (HSB): Store the high bits of data in the low address space
summary : Small end sequence , Large end reverse order
- The order It refers to the high-low bit order of data and the high-low order of address In the same direction
- The reverse It refers to the high-low bit order of data and the high-low order of address In the opposite direction


Two 、 Code testing
- Different cpu( The big and small end is made up of cpu Decisive ) There are different strategies for storing data :
- Use the following code to determine what byte order the computer uses
#include <stdio.h>
int main()
{
int a = 0x12345678;
char *b = (char *)&a;// Use char The type pointer is a value that you want to take only 1Byte
if(*b == 0x12)
printf(" Big end \n");
else if(*b == 0x78)
printf(" The small end \n");
return 0;
}

- Usually computers use small endian byte order to store data , The data transmission in the network adopts large end byte order
边栏推荐
猜你喜欢

带你认识图数据库性能和场景测试利器LDBC SNB

esp32s3 IPERF例程测试 esp32s3吞吐量测试

Nmcli team bridge basic configuration

C语言 函数指针与回调函数

ACL 2022 | 中科院提出TAMT:TAMT:通过下游任务无关掩码训练搜索可迁移的BERT子网络

What is the next step in the recommendation system? Alispacetime aggregates GNN, and the effect is to sling lightgcn!

xxl-job学习梳理
![Dynamic programming [III] (interval DP) stone merging](/img/a4/82c4d63b8df5d092a96b80dd497147.jpg)
Dynamic programming [III] (interval DP) stone merging

让学指针变得更简单(一)

Interview shock 60: what will cause MySQL index invalidation?
随机推荐
DM8:达梦数据库-锁超时
Sword finger offer 04 Find in 2D array
[on Nacos] get started quickly
JMeter connection DM8
Mybaitis generator details
Pyqt, pyside slot functions are executed twice
Self taught ADT and OOP
浏览器cookie转selenium cookie登录
Talk about go language and cloud native technology
Three traversal methods of binary tree
esp32s3 IPERF例程测试 esp32s3吞吐量测试
Airbnb double disk microservice
Failed to execute NPM instruction, prompting ssh: Permission denied
Deep understanding of happens before principle
Neo4j: basic introduction (I) installation and use
Uniapp drop-down layer selection box effect demo (sorting)
Database Series: MySQL index optimization and performance improvement summary (comprehensive version)
全球最快下载工具 XDM
Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing
Topic38——56. Consolidation interval