












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Prof. Abhay Aggrawal delivered this lecture at Birla Institute of Technology and Science for lab of Assembly Language Programming. It includes: Multiplication, MAX, Binary, Instruction, Operands, IMUL, Division, Quotient, Remainder, Dividened
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













(unsigned multiply)
instruction
multiplies an 8-, 16-, or 32-bit operand by eitherAL, AX, or EAX.
binary form.
instruction
formats are:
MUL Reg / Mem. Of 08 bits
-^
MUL Reg / Mem. Of 16 bits
-^
MUL Reg / Mem. Of 32 bits
08 Bit Multiplication
always in the AL register(unsigned). Themultiplier can be 8 bit register or memorylocation.
multiplies the operand times the contents ofregister AL.
stored in AX(16-bit) register because theresult is always the double of operand.
16 Bit Multiplication
always in the AX register(unsigned). Themultiplier can be 16 bit register or memorylocation.
stored in DX:AX register because the result isalways the double of operand.
bits of the product & AX contains the least-significant (lower) 16 bits of result.
MOV CX , 2000h
Moving Multiplier in CX
MOV AX , 100h
Moving Multiplicand in AX
Generating Product
32-bit Result in DX:AX
00200000h,
product contains significant digits.
MOV ECX , 12345h
Moving Multiplier in ECX
MOV EAX , 1000h;
Moving Multiplicand in EAX
Generating Product
;^ 32-bit Result in EDX:EAX
EDX:EAX = 0000000012345000h, CF=
product contains significant digits.
(signed multiply)
instruction
multiplies an 8-, 16-, or 32-bit operand by eitherAL, AX, or EAX.
2’s compliment.
instruction
formats are:
IMUL Reg / Mem. Of 08 bits
-^
IMUL Reg / Mem. Of 16 bits
-^
IMUL Reg / Mem. Of 32 bits
instruction
is used
for an 8-, 16-, or 32-bit unsigned division.
that is divided by the operand. It means that an8-bit division divides 16-bit number by 08-bitnumber, a 16-bit division divides a 32-bitnumber by 16-bit number and same as 32-bitdivision.
08 Bit Division
the dividend that is divided by the contents ofany 8-bit register or memory location.
contains the remainder after the division.
Important:^ • The important thing is that the dividend must
be of 16-bit. If it is not, then convert it into 16-bit then use the DIV instruction.
16 Bit Division
store the dividend that is divided by thecontents of any 16-bit register or memorylocation.
DX contains the remainder after the division.
Important:^ • The important thing is that the dividend must
be of 32-bit. If it is not, then convert it into 32-bit then use the DIV instruction.
simply put 16 zeros in the upper half of the dividend.
mov ax , no
; 16-bit 1
st
No.
mov dx,
; converting it to 32-bit
div no
; dividing by 2
nd
No.
mov qot , ax
; save quotient
mov rem , dx
; save remainder
simply put 32 zeros in the upper half of the dividend.
mov eax , no
; 32-bit 1
st
No.
mov edx,
; converting it to 64-bit
div no
; dividing by 2
nd
No.
mov qot , eax
; save quotient
mov rem , edx
; save remainder
instruction
is used
for an 8, 16, 32 bit signed division.
that is divided by the operand. It means that an8-bit division divides 16-bit number by 08-bitnumber, a 16-bit division divides a 32-bitnumber by 16-bit number and same as 32-bitdivision.
extends the 16-bit into signed 32-bit number. Example:
mov ax , no
; 16-bit 1
st
No.
cwd
; converting it to 32-bit
div no
; dividing by 2
nd
No.
mov qot , ax
; save quotient
mov rem , dx
; save remainder
sign-extends the 32-bit into 64-bit signed number. Example:
mov eax , no
; 32-bit 1
st
No.
cdq
; converting it to 64-bit
div no
; dividing by 2
nd
No.
mov qot , eax
; save quotient
mov rem , edx
; save remainder