Microprocessor and Interfacing Theory Assignment-1
Microprocessor and Interfacing Theory Assignment-1
Microprocessor and Interfacing Theory Assignment-1
~
P>: /7.f!Jat-
p:p; 1_,t)ZcJA.__
Yz/-: /D{OA-
rliL 8 -
:_ c;-o~tJI/
ZWL&&iiii ::...------
Microprocessor and Interfacing theory Assignment-1
Name: Sriharsha Chinta
Reg.No: 20BCE2049
Slot: D2
The MUL instruction deals with the multiplication of two unsigned numbers. There are
types of multiplication depending on the number of bits:
Emulator Result
16-Bit Multiplication
The following statements multiply the 16-bit value 2000H by 0100H. The Carry flag is set
because the upper part of the product (located in DX) is not equal to zero:
Emulator Result
The IMUL instruction allows the multiplication of two signed operands. The operands can
be positive or negative. When the operand is a byte, it is multiplied with AL register and
when it is a word, it is multiplied with AX register. The operation of MUL and IMUL
instructions are same. The only difference between two is one deals with the multiplication
of unsigned numbers and the other deals with signed operands.
If the product of multiplier and multiplicand produce result that fits into the destination
register DX and AX with some of the bits left unused. Then these unused bits are filled with
the copies of signed bit and clear CF and OF flags to zero.
Emulator Result
The main difference between MUL and IMUL is that MUL multiplies the 'unsigned
numbers'. IMUL multiplies 'signed numbers'.
Explanation:
• The MUL and IMUL are multiplication instructions. Here, MUL instructions used for
multiplying unsigned numbers. On the other hand, IMUL multiplies signed numbers.
• For these instructions, one factor should be in the accumulator register. The other
factor can be in any of the memory operand or single register.
• The IMUL instruction with multiple operands can be used for both signed – unsigned
multiplication. This is because, the 16 bit product will be same in both case.
When multiplying N-bit number by other N-bit one, the low N bits of the result are the
same no matter whether you do the signed or unsigned. So both 32-bit MUL and IMUL
produce the same low 32 bits of result. For this reason though there are additional variants
of IMUL that can store result in any 32-bit register or memory location, there are no such
for MUL, since they would do exactly the same. The difference is in case when the result is
stored as 64 bits in EDX:EAX, and high 32 bits (in EDX) may differ.
a) 3A.3
b) 219.C
c) CA.DC
(CA. DC) ₁₆ = (12 × 16¹) + (10 × 16⁰) + (13 × 16⁻¹) + (12 × 16⁻²) = (202.859375) ₁₀
d) FBB.3
e) B8B.0E
a) SUB CX, BX
f) SUB AGAIN, AL