MUL operation in assembly

前端 未结 2 2022
名媛妹妹
名媛妹妹 2021-01-07 13:12

i have the following assembly lines:

...
MOV ECX, 0x36EE80
MOV EDX, 0x95217CB1
MUL EDX
SHR EDX, 0x15
MOV DWORD PTR SS:[EBP-0x3C8], EDX
....
....
相关标签:
2条回答
  • 2021-01-07 13:18

    The description for MUL r/m32 is Unsigned multiply (EDX:EAX <- EAX * r/m32)..

    That means that the 64-bit product will be stored in EDX:EAX, i.e. the upper 32 bits ends up in EDX and the lower 32 bits in EAX. Which fits with the results you're seeing, since the product should be 0x1DBEE41EB22A9CB.

    0 讨论(0)
  • 2021-01-07 13:41

    Result is 01DBEE41 EB22A9CB, EDX stores high part of it.
    Decimal numbers are not concatenatable when dealing with binary representation of numbers.

    0 讨论(0)
提交回复
热议问题