为什么VISUAL C ++ 2010使用的内存寻址大会语法? [英] Why is Visual C++ 2010 using this Assembly syntax for memory addressing?

查看:174
本文介绍了为什么VISUAL C ++ 2010使用的内存寻址大会语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我转换下面的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屋!

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