首页 > 解决方案 > I get a different result with mul instruction in assembly

问题描述

I have this set of instructions in assembly.

   mov ax,0055h
   mov bx,11AAh
   mul al
   xchg ax,bx
   not ax
   neg bx

I don't understand the mul instruction in third line.If I do 0055h*11AAh I get 5DD72 but it's not correct because with a program I get in AX 1C39.How ? What's the procedure?

I know that AX and BX are 16 bit registers and my result should be on 32 bit and the result is on DX:AX

标签: assemblyx86

解决方案


的单参数形式将根据操作数大小将参数与///mul相乘,并将结果相应地存储在///中。alaxeaxraxaxdx:axedx:eaxrdx:rax

mul al将乘以al并将al结果存储在ax. 你想要mul bx


推荐阅读