The document discusses division and multiplication in assembly language, noting that multiplication uses the MUL instruction with one operand as the source and the result stored in the AX register. It also provides an example program that allows a user to enter two numbers and prints their multiplication, and explains how the AAM and AAD instructions can be used to adjust results after and before division operations involving numbers larger than 9.
The document discusses division and multiplication in assembly language, noting that multiplication uses the MUL instruction with one operand as the source and the result stored in the AX register. It also provides an example program that allows a user to enter two numbers and prints their multiplication, and explains how the AAM and AAD instructions can be used to adjust results after and before division operations involving numbers larger than 9.
The document discusses division and multiplication in assembly language, noting that multiplication uses the MUL instruction with one operand as the source and the result stored in the AX register. It also provides an example program that allows a user to enter two numbers and prints their multiplication, and explains how the AAM and AAD instructions can be used to adjust results after and before division operations involving numbers larger than 9.
The document discusses division and multiplication in assembly language, noting that multiplication uses the MUL instruction with one operand as the source and the result stored in the AX register. It also provides an example program that allows a user to enter two numbers and prints their multiplication, and explains how the AAM and AAD instructions can be used to adjust results after and before division operations involving numbers larger than 9.
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