关于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 ...
随机推荐
- js中方法类型比较
参考链接 http://bbs.csdn.net/topics/390775296/ function People(name){this.name=name;//对象方法this.Introduce ...
- XXE篇-本着就了解安全本质的想法,尽可能的用通俗易懂的语言去解释安全漏洞问题
0x01 Brief Description XXE(XML External Entity) XML外部实体攻击也是常见的web漏洞之一,在学习这个漏洞之前有必要了解一下xml,可以参考w3c的基本 ...
- Heritrix的安装与配置 (最新版 已测试通过)
本教程,结合本人亲身实践,不仅适合于最新版本Heritrix 1.14.4,更适合其他任何版本.Heritrix具体下载地址如下: http://sourceforge.net/projec ...
- ViewPager禁止滑动以及它与内层滑动控件水平方向上事件冲突的解决方法
一.上图 二.场景描写叙述 最近在做项目的时候.遇到一个怪异的需求,描写叙述例如以下: 1.ViewPager中嵌套3个View,当从View1滑动到View2时禁止ViewPager的滑动事件. 2 ...
- Flashback Version Query、Flashback Transaction Query快速闪回细粒度数据
Flashback Version Query 闪回版本查询 使用Flashback Version Query 返回在指定时间间隔或SCN间隔内的所有版本,一次commit命令就会创建一个版本. ...
- ApiDemos-->Views-lists-slow adapter学习
今天来依照apidemos提供的方法来实现slow loading的效果. 简单说下实现方法: 实现ListView.OnScrollListener ,监听到手势滑动的情况,当处于滚动状态时,将新显 ...
- mongodb的tailCursor的设计思想
http://derickrethans.nl/mongodb-and-solr.html 这是mongodb的php客户端的写法
- cassandra新增、更新、删除数据。
package client; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java ...
- 利用eclipse开发php<转>
1.安装php环境 Eclipse支持PHP自动提示 其实如果你已经安装好了php环境(安装过程见)的话,只需要下面2步就可以了.hoho,很简单的. 1,下载eclipse中php的插件phpecl ...
- 一个控制台贪吃蛇小游戏(wsad控制移动)
/******************************************** * 程序名称:MR.DUAN 的贪吃蛇游戏(链表法) * 作 者:WindAutumn <flutti ...