新闻  |   论坛  |   博客  |   在线研讨会
Arm Memory Format(Little-endian and Big-endian)
xiajiashan | 2012-08-28 17:07:38    阅读:745   发布文章

 

我读书时很憎恨English,但是这么多年的工作,我喜欢上了English,我不得不喜欢他,所有的技术文档的白皮书,规范都出自E文,只有做技术后才知道自己国家技术的落后,但是我真的希望我们现在做技术的,以及今后做技术的能够多点原创,包括文档,设计,研究,虽然我们国家的环境不容这样,我们疲于生计,只有抄,”偷”才能得以温饱,我辛辛苦苦花了一个上午把这篇文档写好,我在做公益,高校的老师都是留校的,研究院的领导已不做试验…,罗嗦了几句,发发牢骚,有同感的捧个”钱”场,没有同感的捧个”点击率

Arm Memory Format

者:下家山(索漫科技培训教材,原创作品,转载请注明,下家山)

一:Memory formats

下面是arm官方文档说明:

Memory formats

The ARM720T processor views memory as a linear collection of bytes numbered

upwards from zero, as follows:

Bytes 0 to 3 Hold the first stored word.

Bytes 4 to 7 Hold the second stored word.

Bytes 8 to 11 Hold the third stored word.

Words are stored in memory as big or little-endian

The endianness used depends on the status of the B bit in the Control Register of the

system control coprocessor. See Control Register on page 3-5 for more information.

翻译:

存储格式

ARM720T(arm9,10,11,a8,a9都一样)处理器把存储器当作一个从0向上的线性字节编号集合,例如:

字节0-3占据第一个存储字。

字节4-7占据第二个存储字。

字节8-11占据第三个存储字。

而,这些字被存储在内存以大端或小端方式。

是否采用什么端点由系统控制协处理器的控制寄存器的B位状态决定。

二:Big-endian format

In big-endian format, the most significant byte of a word is stored at the lowest

numbered byte and the least significant byte at the highest numbered byte. Byte 0 of the

memory system is therefore connected to data lines 31 to 24.

Big-endian format is shown in Figure 2-1.

在大端格式,一个字的最高有效字节被存储在最低编号字节上,最低有效字节被存储在最高编号字节上。因此,内存系统的0号字节被链接到31-24号地址总线。

2.jpg

Note

• Most significant byte is at lowest address

• Word is addressed by byte address of most significant byte.

注意:

最高有效字节位于最低地址

字按照最高有效字节所在地址寻址

2.1 大端实例分析

其实E文已说明的很清晰,如果E文不好(

我读书时很憎恨English,但是这么多年的工作,我喜欢上了English,我不得不喜欢他,所有的技术文档的白皮书,规范都出自E文,只有做技术后才知道自己国家技术的落后,但是我真的希望我们现在做技术的,以及今后做技术的能够多点原创,包括文档,设计,研究,虽然我们国家的环境不容这样,我们疲于生计,只有抄,”偷”才能得以温饱,我辛辛苦苦花了一个上午把这篇文档写好,我在做公益,高校的老师都是留校的,研究院的领导已不做试验…,罗嗦了几句,发发牢骚,有同感的捧个”钱”场,没有同感的捧个”点击率”),翻译也很明了。

我们这里有三个十进制数按先后顺序存放在内存 :

2954015906 2721894998 1797011999

用十六进制数表示是:0xB012B4A2 0xA23CD256 0x6B1C3A1F

那么这个数在大端内存里面是怎么存放的呢?

 

 
 
 
3.jpg
三:Little-endian format

In little-endian format, the lowest numbered byte in a word is considered the least

significant byte of the word, and the highest numbered byte the most significant. Byte

0 of the memory system is therefore connected to data lines 7 to 0.

在小端格式,在一个字上的最低编号字节当作这个字的最低有效字节,最高编号字节当作这个字的最高有效字节。因此,内存系统的0号字节被链接到7-0号地址总线。

 

Little-endian format is shown in Figure 2-2.

 

 
 
 
 
1.jpg
 

Note

• Most significant byte is at lowest address

• Word is addressed by byte address of least significant byte.

注意:

最高有效字节位于最低地址

字按照最低有效字节所在地址寻址

3.1 小端实例分析

同上,我们这里有三个十进制数按先后顺序存放在内存 :

2954015906 2721894998 1797011999

用十六进制数表示是:0xB012B4A2 0xA23CD256 0x6B1C3A1F

那么这个数在小端内存里面是怎么存放的呢?

 

 
 
 
4.jpg
 

2012-6-19

写于上海松江

【上海索漫提供】请尊重原创,转载请注明:作者,下家山

*博客内容为网友个人发布,仅代表博主个人观点,如有侵权请联系工作人员删除。

参与讨论
登录后参与讨论
02年接触ARM和ucos,开发过有线和无线图像报警器,IPCamera,人脸识别系统,OCR识别系统,指纹识别系统,05年开始从事Linux及Rtems下WiFi,camera,Ethernet等驱动开发工作,专做嵌入式linux培训,致力于把我十年来的研发经验传授给每一个学员,招人的可以找我,ximenpiaoxue4016@sina.com
推荐文章
最近访客