关于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 ...
随机推荐
- java集合简介
java集合主要包括以下几点 Java 集合概述 Collection 接口 Iterator 接口 Set List Map Collections 工具类 Enumeration 1.java集合 ...
- 剑指offer---3
1.反转单链表,输入链表的头节点,输出该链表,并输出反转后的头节点 这个题目不用再说了,写过N边了 SLnode reverse(SLnode head) { SLnode reverse_head ...
- linux下ssh使用和配置
常用格式:ssh [-l login_name] [-p port] [user@]hostname 更详细的可以用ssh -h查看. 举例 不指定用户: ssh 192.168.0.11 指定用户: ...
- html自定义提示框
自定义html提示框比较令人困惑的就是编写三角形的样式:以前的实现方式是在标签内使用span标签来实现.不过现在有了css提供的两个为类:before,:after之后,可以不用再内置span标签了: ...
- NetworkX学习笔记-5-NetworkX中怎样对多个网络赋属性,并根据属性排序
这是我在数据分析过程中遇到的实际问题,简单记录一下.这里以DiGraph为例,其他类型的网络(图)的处理方法是一样的. 按照这里:http://networkx.github.io/documenta ...
- iOS UITextField 设置内边距
[self.yourTextField setValue:[NSNumber numberWithInt:5] forKey:@"_paddingTop"]; [self.your ...
- layout布局实例化
实例化xml中的Layout布局在开发中经常会用到,有几种方法可以使用 1.在Activity中使用getLayoutInflater()方法 View layout = getLayoutInfla ...
- [转] boost::any的用法、优点和缺点以及源代码分析
boost::any用法示例: #include <iostream> #include <list> #include <boost/any.hpp> typed ...
- Java基础知识强化之IO流笔记04:throw和throws的区别
1. throw概述 在功能方法内部出现某种问题,程序不能继续运行,需要进行跳转时,就用throw把异常对象抛出. 2. 案例演示: (1) package com.himi.throwdemo; p ...
- MM32看门狗学习(兼容STM32)
MM32看门狗学习(兼容STM32) IWDG独立看门狗 思维导图 IWDG框图与理解 1.独立看门狗分为两个部分,配置寄存器在1.8V供电区,计数器的核心部分在VDD供电区(即使停机/待机模式计数器 ...