Should I use “mul” or “imul” when multiplying a signed number to an unsigned number?
问题 I have found out that both mul and imul can be used to multiply a signed number to an unsigned number. For example: global _start section .data byteVariable DB -5 section .text _start: mov al, 2 imul BYTE [byteVariable] You can replace imul with mul , and the result would still be the same ( -10 ). Are mul and imul exactly the same when multiplying a signed number to an unsigned number, or is there a difference between them? 回答1: The upper half is different, as mentioned in the comments. If