I know mul is used for multiplying unsigned numbers and IMUL is used for multiplying signed numbers , just wanted to know whether mul considers signed operands as unsigned
Asked
Active
Viewed 518 times
0
-
3There's nothing inherently "signed" or "unsigned" about an operand to a machine instruction. They're just bits. Yes, MUL treats its operands as unsigned integers; that's what it means that it's an "unsigned multiply" instruction. – Nate Eldredge Nov 22 '20 at 06:43
-
thanks to twos complement addition and subtraction dont need to know nor care to perform the operation. Multiplication and division definitely care IF you are using a variable number of bits for example two 16 bit operands multiplying into a 32 bit result that has to know signed vs unsigned to sign extend or zero pad to do the operation. Likewise with division if the numerator has more bits than the denominator the logic has to know to sign extend or zero pad. But if it is all the same number of bits then multiply and divide dont care about signedness either. – old_timer Nov 23 '20 at 10:19
-
what part of the intel documentation did you not understand? – old_timer Nov 23 '20 at 10:20