什么是在&QUOT和0x​​10;莱亚尔为0x10(%EBX),%eax中" x86汇编指令? [英] What is the 0x10 in the "leal 0x10(%ebx), %eax" x86 assembly instruction?

查看:317
本文介绍了什么是在&QUOT和0x​​10;莱亚尔为0x10(%EBX),%eax中" x86汇编指令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该功能是为0x10的关于这个leal指令是什么?它是一个乘法或添加或别的东西?

What the function is of the 0x10 in regards to this LEAL instruction? Is it a multiply or addition or is something else?

leal 0x10(%ebx), %eax

有人可以请你澄清?这是在Linux机器x86汇编。

Can someone please clarify? This is x86 assembler on a Linux box.

推荐答案

莱亚尔,或执法机关的全称是加载有效地址,它究竟这样的:它做一个地址计算

leal, or lea full name is "Load effective address" and it does exactly this: It does an address calculation.

在你的榜样地址计算很简单,因为它只是增加了一个偏移量EBX和结果存储在EAX:

In your example the address calculation is very simple, because it just adds a offset to ebx and stores the result in eax:

EAX = EBX + 0×10

eax = ebx + 0x10

LEA可以做更多的事情。它可以与常量2,4和8的话,整体和双打地址计算添加寄存器,乘法寄存器。它也可以加一个偏移量。

lea can do a lot more. It can add registers, multiply registers with the constants 2, 4 and 8 for address calculations of words, integers and doubles. It can also add an offset.

需要注意的是执法机关是它永远不会改变标志的方式特殊,即使你使用它作为一个简单的加法就像上面的例子。编译器有时会利用此功能,并通过执法机关替换除了帮调度。这并不少见LEA指令做简单的算术编译code这个原因。

Note that lea is special in the way that it will never modify the flags, even if you use it as a simple addition like in the example above. Compilers sometimes exploit this feature and replace an addition by a lea to help the scheduler. It's not uncommon to see lea instructions doing simple arithmetic in compiled code for that reason.

这篇关于什么是在&QUOT和0x​​10;莱亚尔为0x10(%EBX),%eax中" x86汇编指令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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