在x86汇编语言中使用little-endian标记有什么好处? [英] What benefits does the use of the little-endian notation have in x86 assembly language?

查看:129
本文介绍了在x86汇编语言中使用little-endian标记有什么好处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

为什么x86是little endian?

我个人是这样,并且我敢打赌,很多人都会同意这一点,发现big-endian字节顺序表示法更易于阅读和理解。我想大尾数字节排序对于CPU来说就像小尾数字节排序一样容易。

I personally, and I bet many will agree to this, find that big-endian byte ordering notation is easier to read and understand. I suppose big-endian byte ordering is just as easy for the CPU to process as little-endian byte ordering.

在文章 x86的黑暗角落,大卫·奇斯纳尔(David Chisnall)指出

In the article The Dark Corners of x86, David Chisnall states that

[...]当时似乎是个好主意的功能已逐渐添加,直到我们被称为现代x86架构的废话。

"[...] features that looked like a good idea at the time were gradually added until we were left with the kludge known as the modern x86 architecture."

由于大端字节序应该很容易处理(即使不那么容易处理),特别是在涉及浮点类型时,什么好处很少-

Since big-endian byte ordering should be just as easy -if not easier- to process, especially when it comes to floating-point types, what benefits does little-endian provide over big-endian?

推荐答案

无。

对于使用 大端顺序或小端顺序的架构,确实没有特定的理由;有些人喜欢他们每个人。甚至有一些芯片可以同时做这两个!但是,在大多数情况下,架构会选择一种顺序,这就是您所要遵循的。而且,即使有充分的理由,世界上也有太多x86代码无法切换命令。

There really is no specific reason for an architecture to use either big-endian or little-endian ordering; there are people who prefer each of them. There have even been some chips that can do both! But for the most part, an architecture chooses an ordering, and that's what you go with. And there is far too much x86 code in the world for switching orderings to make sense, even if there were a good reason.

这篇关于在x86汇编语言中使用little-endian标记有什么好处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆