IMUL 指令的用法

leechhui 2010-03-01 03:00:24
最近在读看雪的《加密与解密》一书,为了能看懂里面的汇编代码,我也读了一些汇编方面的书,只不过仅限于汇编指令的用法而已。
今天我反汇编了一个Crackme.exe测试程序,里面有如下的代码:
00401360 |> 33D2 |xor edx, edx
00401362 |. 33DB |xor ebx, ebx
00401364 |. 8A1429 |mov dl, byte ptr [ecx+ebp]
00401367 |. 8A98 30504000 |mov bl, byte ptr [eax+405030]
0040136D |. 0FAFD3 |imul edx, ebx
最后一行imul指令的作用我不太了解,所以就百度搜了一下,但没有找到理想的结果。我在手头的一本书上查了一下,书中说8086中imul指令只有一个操作数,而80x86中有两个乃至三个操作数的用法,但除此之外就没有任何信息了。
希望哪位汇编高手给我讲解一下IMUL指令的详细用法(一定要包括两个操作数的那个)。
...全文
1899 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
leechhui 2010-03-01
  • 打赏
  • 举报
回复
thank you!!!
zara 2010-03-01
  • 打赏
  • 举报
回复
一个操作数的,只是 8086 级的指令吧。 后来的 cpu,因实际程序设计中的需要,增加了很多的指令;最通俗的就是多媒体方面的指令了;对已有的指令,也多有扩充。
nanlingcg 2010-03-01
  • 打赏
  • 举报
回复 1
imul edx, ebx ;edx=edx*ebx
imul edx, ebx,8 ;edx=ebx*8
一,目的数为16或32寄存器
二,操作数长度相等
三,三操作数依次为目的,源,立即数
四,与单操作数不溢出不同,可能产生溢出

就这样简要述说了...
东方之珠 2010-03-01
  • 打赏
  • 举报
回复
网上看了一下有符号乘法IMUL指令,怎么都是一个操作数啊.
zara 2010-03-01
  • 打赏
  • 举报
回复
可能是你手头的版本不够吧。Masm6 附带的 qh 里对 imul 的解释里就已经有多参数的了。
通常是推荐看那个 intel 的指令集参考手册,网上搜索下,可下载的地方应该很多。

Description
Performs a signed multiplication of two operands. This instruction has three forms, depending on the number of operands.
* One-operand form. This form is identical to that used by the MUL instruction. Here, the source operand (in a general-purpose register or memory location) is multiplied by the value in the AL, AX, or EAX register (depending on the operand size) and the product is stored in the AX, DX:AX, or EDX:EAX registers, respectively.
* Two-operand form. With this form the destination operand (the first operand) is
multiplied by the source operand (second operand). The destination operand is a general-purpose register and the source operand is an immediate value, a general-purpose register, or a memory location. The product is then stored in the destination operand location.

* Three-operand form. This form requires a destination operand (the first operand) and two source operands (the second and the third operands). Here, the first source operand (which can be a general-purpose register or a memory location) is multiplied by the second source operand (an immediate value). The product is then stored in the destination operand (a general-purpose register).
When an immediate value is used as an operand, it is sign-extended to the length of the destination operand format.
zhangliufang 2010-03-01
  • 打赏
  • 举报
回复

imul reg,reg/mem
源操作数与目的操作数必须长度相同,且源操作数必须是通用寄存器,目的操作数可以是寄存器也可以是内存操作数。

若乘积结果目标寄存器不能容纳,则cf/of = 1

21,497

社区成员

发帖
与我相关
我的任务
社区描述
汇编语言(Assembly Language)是任何一种用于电子计算机、微处理器、微控制器或其他可编程器件的低级语言,亦称为符号语言。
社区管理员
  • 汇编语言
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧