为什么VISUAL C ++ 2010使用的内存寻址大会语法? [英] Why is Visual C++ 2010 using this Assembly syntax for memory addressing?
问题描述
我转换下面的C ++ code到组件中使用Visual C ++ 2010:
I converted the following C++ code into Assembly using Visual C++ 2010:
int main()
{
int i;
i = 1234;
return 0;
}
我收到了以下的输出:
I received the following output:
根据我的了解内存寻址,为内存地址的计算总是放在方括号里面,所以为什么是 _i $
在这种情况下被放置方括号之外吗?
Based on my understanding of memory addressing, the computation for the memory address is always placed inside of the square brackets, so why is the _i$
in this case is placed outside of the square brackets?
推荐答案
微软的汇编器将像 A [B]
关于以同样的方式C或C ++会这么 A [b]
和 b [A]
是pretty多少等价的。双方表示除了和一些可选的比例其次是提领,但不要放置很多的要求。有关这部分的地址,哪一部分是指数。
Microsoft's assembler treats something like a[b]
about the same way C or C++ would so a[b]
and b[a]
are pretty much equivalent. Both indicate addition and some optional scaling followed by dereferencing, but don't place many requirements about which part is "address" and which part is "index".
这篇关于为什么VISUAL C ++ 2010使用的内存寻址大会语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!