86 lea指令 [英] x86 lea instruction

查看:266
本文介绍了86 lea指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想获得在x86的机关指令良好的抓地力:

 莱亚尔(%EDX,EDX%,4),EAX%
莱亚尔(%EDX,EDX%,2),%eax中

由于这两条线,我知道:

EAX = EDX + EDX * 4

然后

EAX = EDX + EDX * 2

两个问题。首先,如果这些指示出现在序列在本实施例中,EAX寄存器一旦第二线执行覆盖?而究竟会被加载到寄存器?另一个地址?或者是对这些寄存器指向值这个算术运算?


解决方案

  

如果这些指示出现在序列在本实施例中,eax中
  寄存器是重写一次,第二行执行?


是(这是两个指令后覆盖)


  

和究竟会被加载到寄存器?另一个地址?


通过EDX描述的内存地址+偏移量存储为乘以2 EDX值

I am trying to get a good grip on the LEA instruction in x86:

leal (%edx, %edx, 4), %eax
leal (%edx, %edx, 2), %eax

Given these two lines, i know that:

eax = edx + edx*4

and then

eax = edx + edx*2

Two questions. First, if these instructions appear in sequence as in this example, the eax register is overwritten once the second line executes? And what exactly would be loaded into the register? Another address? Or is this doing arithmetic on the values that these registers point to?

解决方案

if these instructions appear in sequence as in this example, the eax register is overwritten once the second line executes?

Yes (it is overwritten after both instructions)

And what exactly would be loaded into the register? Another address?

The memory address described by EDX + the offset stored as value in EDX multiplied by 2

这篇关于86 lea指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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