big and little endian
总是容易搞混big endian 和 little endian,但是找到一篇文章,其解释让人耳目一新。
文章链接:http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/Data/endian.html
假设内存 byte-addresseable,假设我们要保存一个32bit的数据,以16进制表示为 90AB12CD。
有两种保存方式:
1. store the most significant byte in the smallest address,也就是所谓的 big endian。
2. store the least significant byte in the smallest address,也就是所谓的 little endian。
因为 the least significant byte is stored first,所以叫 little endian.
因为 the most significant byte is stored first,所以叫 big endian.
文章中介绍的内容包括但不限于这些,还介绍了 endian 的影响之类的内容。
啦啦啦!!!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步