关于C51中“大小端存储”问题的详解
1. Little-Endian(小端存储),即将低字节的数据存储于低地址中,Big-Endian(大端存储)反之。
2. 小端存储称为Intel模式,大端存储称为Motorola模式。
3. C51中LCALL指令将下一指令的执行地址压入堆栈中(堆栈地址由低向高增长),先存入低字节地址,再存入高字节地址,亦即使用“小端模式(Intel模式)”;除此之外,C51中的其它指令和数据,均使用“大端模式(Motorola模式)”。
The -bit machine and has no instructions bits. Multi-byte data are stored according to the following rules. The LCALL instruction stores the address of the next instruction on the stack. The address is pushed onto the stack low-order byte first. The address is, therefore, stored in memory in little endian format. All other -bit and -bit values are stored, contrary to other Intel processors, -bit addresses that are in big endian format. Floating-point numbers are stored according to the IEEE- format and are stored in big endian format with the high-order byte stored first. --引用参考:Keil Cx51 User‘s Guide -> Appendix -> E. Byte Ordering. --http://www.keil.com/support/man/docs/c51/c51_xe.htm
4. Keil编译器不能按用户需求设置大小端的存储模式。
SYMPTOMS My hardware's set up for big endian, but the compiler seems to be storing things little endian. Is there a compiler option to reverse the way data is stored? CAUSE At this time, there is no functionality in any of the compilers to effect a "global" change in the way data is stored. --引用参考:http://www.keil.com/support/docs/730.htm
5. 8051系列MCU中,用C语言进行编程时,数据的存储模式由编译器(Compiler)决定,如Keil C51 Compiler 4.0版本开始使用“大端存储模式”,而较早前的编译器版本中使用的是“小端存储模式”。
Version 4.0 Differences Home » Appendix » B. Version Differences » Version 4.0 Differences Byte Order of Floating-point Numbers Floating-point numbers are now stored in the big endian order. Previous releases of the C51 compiler stored floating-point numbers in little endian format. Refer to Floating-point Numbers for more information. --引用参考:http://www.keil.com/support/man/docs/c51/c51_xb_ver4dif.htm
6. 主流MCU架构关于endian的配置:
使用小端(Little- (including , 65C816), Z80 (including Z180, eZ80 etc.), MCS-, , DEC Alpha, Altera Nios, Atmel AVR, SuperH, VAX, 和 PDP- 等等; 使用大端(Big- and 68k, Xilinx Microblaze, IBM POWER, system/, System/ 等等。 支持配置endian的架构:如下架构有配置endian为大端、小端中任一种的功能, ARM, PowerPC, Alpha, SPARC V9, MIPS, PA-RISC 和 IA- 等等。 --引用参考:http://smilejay.com/2012/01/big-endian_little-endian/
--编者注:ARM架构中,可通过对功能寄存器进行设置,从而切换至Big-Endian或Small-Endian存储模式。
关于C51中“大小端存储”问题的详解的更多相关文章
- Java中堆内存和栈内存详解2
Java中堆内存和栈内存详解 Java把内存分成两种,一种叫做栈内存,一种叫做堆内存 在函数中定义的一些基本类型的变量和对象的引用变量都是在函数的栈内存中分配.当在一段代码块中定义一个变量时,ja ...
- Java中的equals和hashCode方法详解
Java中的equals和hashCode方法详解 转自 https://www.cnblogs.com/crazylqy/category/655181.html 参考:http://blog.c ...
- Linux中redis安装配置及使用详解
Linux中redis安装配置及使用详解 一. Redis基本知识 1.Redis 的数据类型 字符串 , 列表 (lists) , 集合 (sets) , 有序集合 (sorts sets) , 哈 ...
- 转:Java中的equals和hashCode方法详解
转自:Java中的equals和hashCode方法详解 Java中的equals方法和hashCode方法是Object中的,所以每个对象都是有这两个方法的,有时候我们需要实现特定需求,可能要重写这 ...
- Python中操作mysql的pymysql模块详解
Python中操作mysql的pymysql模块详解 前言 pymsql是Python中操作MySQL的模块,其使用方法和MySQLdb几乎相同.但目前pymysql支持python3.x而后者不支持 ...
- 教程-Delphi中Spcomm使用属性及用法详解
Delphi中Spcomm使用属性及用法详解 Delphi是一种具有 功能强大.简便易用和代码执行速度快等优点的可视化快速应用开发工具,它在构架企业信息系统方面发挥着越来越重要的作用,许多程序员愿意选 ...
- 在ASP.NET 5应用程序中的跨域请求功能详解
在ASP.NET 5应用程序中的跨域请求功能详解 浏览器安全阻止了一个网页中向另外一个域提交请求,这个限制叫做同域策咯(same-origin policy),这组织了一个恶意网站从另外一个网站读取敏 ...
- c++中内存拷贝函数(C++ memcpy)详解
原型:void*memcpy(void*dest, const void*src,unsigned int count); 功能:由src所指内存区域复制count个字节到dest所指内存区域. 说明 ...
- Android 中各种权限深入体验及详解
Android 中各种权限深入体验及详解 分类: Android2012-07-15 19:27 2822人阅读 评论(0) 收藏 举报 androidpermissionsinstallersyst ...
随机推荐
- SSLStrip 的未来 —— HTTPS 前端劫持
前言 在之前介绍的流量劫持文章里,曾提到一种『HTTPS 向下降级』的方案 —— 将页面中的 HTTPS 超链接全都替换成 HTTP 版本,让用户始终以明文的形式进行通信. 看到这,也许大家都会想到一 ...
- Python学习笔记2-flask-sqlalchemy 简单笔记
flask-sqlalchemy 简单笔记 字数 阅读 评论 喜欢 flask-sqlalchemy SQLAlchemy已经成为了python世界里面orm的标准,flask是一个轻巧的web框架, ...
- jquery动态添加元素无法触发绑定事件的解决方案。
jquery动态添加元素无法触发绑定的事件的解决方案. ╭(●`∀´●)╯二狗最近在工作中遇到一个问题,即当用jquery动态添加元素后,发现给动态添加的元素却无法触发事件(╯#-_-)╯╧═╧ ( ...
- javascript 数组 排除null, undefined, 和不存在的元素
The most common way to loop through the elements of an array is with a for loop: var o = [1,2,3,4,5] ...
- 【高级算法】模拟退火算法解决3SAT问题(C++实现)
转载请注明出处:http://blog.csdn.net/zhoubin1992/article/details/46453761 ---------------------------------- ...
- Windows 驱动开发 - 5
上篇<Windows 驱动开发 - 4>我们已经完毕了硬件准备. 可是我们还没有详细的数据操作,比如接收读写操作. 在WDF中进行此类操作前须要进行设备的IO控制,已保持数据的完整性. 我 ...
- linux开关机命令
1.reboot重启 2.shutdown -r now 立即重启 root用户使用,与reboot命令相同 3.shutdown -r 10 过10分钟后重启root用户使用 4.shutdown ...
- 【转】大素数判断和素因子分解【miller-rabin和Pollard_rho算法】
集训队有人提到这个算法,就学习一下,如果用到可以直接贴模板,例题:POJ 1811 转自:http://www.cnblogs.com/kuangbin/archive/2012/08/19/2646 ...
- noip 2009 细胞分裂
/*数论题 考察唯一分解定理 当然用到一些技巧*/ #include<iostream> #include<cstdio> #include<cstring> #d ...
- CSS3 过滤
CSS3 过滤 通过CSS3,我们可以在不适用flash动画或JavaScript的情况下,当元素从一种样式变换为另一种样式时为元素添加效果. 浏览器支持 属性 浏览器支持 transition ...