汇编语言整数寄存器 [英] Assembly Language Integer registers
问题描述
我不明白此汇编指令的作用.它的作用是什么?为什么?
I don't understand what this assembly instruction does. What is its effect and why?
imull $16, (%eax, %edx,4)
寄存器的初始值为
%eax= 0x100x
%edx= 0x3
推荐答案
我假设您正在尝试了解如何解释该AT& T样式的汇编指令,尤其是寻址部分.我确定您不需要帮助来了解imull $16
部分的作用-它仅执行有符号乘法,最后一个l
代表long
字.
I'm assuming you're trying to understand how to interpret that AT&T style assembly instruction, in particular the addressing part. I'm sure you don't need help understanding what the imull $16
part does - it simply performs a signed multiplication, the last l
standing for long
word.
(%eax, %edx, 4)
是一种寻址方式,其中您有一个基地址,一定数量元素的偏移量以及一个将元素数量乘以每个元素的大小的比例/乘数:(base, offset, offset scale/multiplier)
.
(%eax, %edx, 4)
is a form of addressing, where you have a base address, an offset of a certain amount of elements, and a scale/multiplier for multiplying the number of elements by the size of each one: (base, offset, offset scale/multiplier)
.
最终得到的是(base + (offset * multiplier)
,因此在这种情况下为:
What you end up with is (base + (offset * multiplier)
, so in this case it'll be:
(%eax + (%edx * 4))
(0x100 + (0x3 * 4))
(0x100 + 0xC)
(0x10C)
因此,指令imull $16, (%eax, %edx,4)
执行16
与地址0x10C
处长字的值的有符号乘法.
Therefore the instruction imull $16, (%eax, %edx,4)
performs a signed multiplication of 16
by the value of the long word at the address 0x10C
.
这篇关于汇编语言整数寄存器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!