“移动$ 0x4050,(%eax)"是什么意思?做? [英] What does "movl $0x4050, (%eax)" do?

查看:212
本文介绍了“移动$ 0x4050,(%eax)"是什么意思?做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说,寄存器%eax包含地址0x100,而在地址0x100处的值为0x3999.

Let's say that register %eax contains address 0x100 and at address 0x100 there is a value 0x3999.

据我了解,%eax"返回地址,例如movl $ 0x4050,%eax将值0x4050移动到地址0x100.

From what I understand "%eax" returns the address, for example movl $0x4050, %eax, moves the value 0x4050 at address 0x100.

但是(%eax)"返回该地址处的值,表示0x3999.那么movl $ 0x4050,(%eax)有什么作用呢?它将常量0x3999视为地址吗?

But "(%eax)" returns the value at the address, meaning 0x3999. So what does movl $0x4050, (%eax) do? Is it going to treat the constant 0x3999 as an address?

推荐答案

如果您熟悉C,可以这样想:

If you're familiar with C, think of it like this:

movl $0x100, %eax     // int* eax = (int*)0x100;
movl $0x4050, (%eax)  // *eax = 0x4050;

movl $0x4050, %eax只是用值0x4050覆盖%eax.在这种情况下,什么都不会解释为地址.

movl $0x4050, %eax just overwrites %eax with the value 0x4050. Nothing is interpreted as an address in this case.

这篇关于“移动$ 0x4050,(%eax)"是什么意思?做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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