Division and Multiplication: By:Manar Yahya & Rajaa Aljada

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 6

Division and Multiplication

By :Manar Yahya & Rajaa Aljada


Multiplication
• Using an Instruction ( Mul )
• Multiplication having one operand is Source
and result will store in AX
Ex :
Mov bl,5d
Mov al,1d
Mul bl ;// Mean Multiple al* bl, the result will
store in ax
• Write a program allow user to enter two
number and print Multiplication
Note : aam(adjust after multiplication)
• Work as follows:
if result >9, the result will stored as hex in al and
then (al/10) stored in ah & (al%10) in al.
• Let 5*4 must print 20
5*4=(14)// in hexadecimal
14 hexa =20decimal
Ah ->(20/10=2)
Al ->(20%10=0)
Note : aad(adjust before division)
Mov Ax,15d
Mov bl,2d
Div bl
aad
Answer in ax,01 07
How ??
Before division, multiplies ah by 10 and adds it to al.
15  01 in ah and 05 in al, aad  01 * 10 + 05 = 15h.
15/2=7 store on al
15%2=1 store in ah

You might also like