![Page 1: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/1.jpg)
Multiplication and Division
Assembly Language
![Page 2: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/2.jpg)
Multiplication
• Use of AX and DX is necessaryi. Byte × Byteii. Word × Wordiii. Word × Byte
![Page 3: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/3.jpg)
Byte × Byte
• One of the operand must be in AL• Second can be register/memory• Result in AX• Example-1
MOV AL, 25HMOV BL, 65HMUL BLMOV myresult, AX
![Page 4: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/4.jpg)
• Example-2MOV AL, DATA1MUL DATA2MOV myresult, AX
![Page 5: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/5.jpg)
Word × Word• One of the operand must be in AX• Second can be register/memory• Result in DXAX• Example-1
DATA3 DW 2387H
DATA4 DW 2F79Hresult 1 DW 2DUP(?)MOV AX, DATA3MUL DATA4MOV RESULT1, AX ;store lower resultMOV RESULT1+2, DX ;store higher result
![Page 6: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/6.jpg)
Word × Byte
• Similar to word × word• AL contains the byte operand• AH must be zero
DATA5 DB 6BHDATA6 DW 12C3HResult3 DW 2DUP(?)MOV AL,DATA5SUB AH,AHMUL DATA6MOV [BX], offset result3MOV [BX], AX MOV [BX]+2, DX
![Page 7: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/7.jpg)
Unsigned Multiplication Summary
Multiplication Operand 1 Operand 2 Result
Byte x byte AL Reg/memory AX
Word x word AX Reg/memory DX:AX
Word x byte AL=byte, AH=0 Reg/memory DX:AX
![Page 8: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/8.jpg)
Unsigned Division Summary
Multiplication Numerator Denominator Quotient Remainder
Byte / byte AL=byet, AH=0 Reg/memory AL AH
Word / word AX=word,DX=0 Reg/memory AX DX
Word / byte AX=word Reg/memory AL AH
Double word/word
DXAX= double word Reg/memory AX DX
![Page 9: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/9.jpg)
Byte/Byte
• Denominator can not be immediate• Example-1
MOV AL,DATASUB AH,AHDIV 10MOV AL, DATA1SUB AH,AHDIV DATA2MOV quot, ALMOV remain, AH
![Page 10: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/10.jpg)
Word/Word
MOV AX,10050SUB DX,DXMOV BX,100DIV BXMOV quot, AXMOV remain,DX
![Page 11: Multiplication and Division Assembly Language. Multiplication Use of AX and DX is necessary i.Byte × Byte ii.Word × Word iii.Word × Byte](https://reader036.vdocuments.mx/reader036/viewer/2022082709/56649cf95503460f949ca597/html5/thumbnails/11.jpg)
Word/Byte
MOV AX, 2055MOV CL, 100DIV CLMOV quot, ALMOV remain, AH