ia-32 汇编中的 3 个操作数 imul 指令究竟做了什么? [英] What exactly does the 3 operand imul instruction do in ia-32 assembly?

查看:45
本文介绍了ia-32 汇编中的 3 个操作数 imul 指令究竟做了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读说明

imul 0xffffffd4(%ebp, %ebx, 4), %eax

我对它到底在做什么感到困惑.我知道 imul 乘法,但我无法弄清楚语法.

and I'm baffled by what it's doing exactly. I understand that imul multiplies, but I can't figure out the syntax.

推荐答案

AT&T 汇编基础/索引语法万岁!它根本不是 3 操作数乘法.它与您熟悉和喜爱的 2 操作数相同,只是第一个有点复杂.这意味着:

Hooray for AT&T assembly base/index syntax! It's not a 3-operand multiply at all. It's the same 2-operand one you know and love, it's just that the first one is a bit complicated. It means:

%ebp + (4 * %ebx) + 0xffffffd4

或者:

%ebp + (4 * %ebx) - 44

更清楚一点(以 10 为基数).AT&T 基础/索引语法分解为:

To be a bit clearer (and in base 10). The AT&T base/index syntax breaks down as:

offset(base, index, multiplier)

这篇关于ia-32 汇编中的 3 个操作数 imul 指令究竟做了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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