IMUL reg/mem8 ; AX = AL * reg/mem8
IMUL reg/meml6 ; DX:AX = AX * reg/meml6
IMUL reg/mem32 ; EDX:EAX = EAX * reg/mem32
IMUL regl6, reg/meml6
IMUL regl6, imm8
IMUL regl6, imml6
IMUL reg32, reg/mem32
IMUL reg32, inun8
IMUL reg32, imm32
IMUL regl6, reg/meml6,imm8
IMUL regl6, reg/meml6, iirrnl6
IMUL reg32, reg/mem32, imm8
IMUL reg32, reg/mem32, imm32
mov rax, -4
mov rbx, 4
imul rbx ; RDX = 0FFFFFFFFFFFFFFFFh, RAX = -16
.data multiplicand QWORD -16 .code imul rax, multiplicand, 4 ; RAX = FFFFFFFFFFFFFFC0 (-64)
mov al,48
mov bl, 4
imul bl ; AX = 00C0h, OF = 1
mov al, -4
mov bl, 4
imul bl ; AX = FFF0h, OF = 0
mov ax, 48
mov bx, 4
imul bx ; DX:AX = 000000C0h, OF = 0
mov eax, +4823424
mov ebx, -423
imul ebx ; EDX:EAX = FFFFFFFF86635D80h, OF = 0
.data word1 SWORD 4 dword1 SDWORD 4 .code mov ax, -16 ; AX = -16 mov bx, 2 ; BX = 2 imul bx, ax ; BX = -32 imul bx, 2 ; BX = -64 imul bx, word1 ; BX = -256 mov eax, -16 ; EAX = -16 mov ebx, 2 ; EBX = 2 imul ebx, eax ; EBX = -32 imul ebx, 2 ; EBX = -64 imul ebx, dword1 ; EBX = -256双操作数和三操作数 IMUL 指令的目的操作数大小与乘数大小相同。因此,有可能发生有符号溢出。执行这些类型的 IMUL 指令后,总要检查溢岀标志位。下面的双操作数指令展示了有符号溢出,因为 -64000 不适合 16 位目的操作数:
mov ax, -32000
imul ax, 2 ; OF = 1
.data word1 SWORD 4 dword1 SDWORD 4 .code imul bx, word1, -16 ; BX = word1 * -16 imul ebx, dword1, -16 ; EBX = dword1 * -16 imul ebx, dword1, -2000000000 ; 有符号溢出!
Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有 粤ICP备16019765号
广州京杭网络科技有限公司 版权所有