Wednesday, June 17, 2020

8086Assembly Program to MULTIPLY two 16-bit BCD numbers(UNSIGNED)

In assembly language 8086 we use mnemonics in order to perform arithmetic operations like  in MUL/IMUL subtraction.
So, Let's dive deep into what  MUL and IMUL is ...

MUL:- It multiplies unsigned byte/word from source with unsigned byte/word in AL/AX register.
Operation:-
When source is BYTE  then, AX← AL* unsigned 8-bit source
When source is BYTE  then, DX: AX← AX* unsigned 16-bit source

IMUL:- It multiplies signed byte/word from source with signed byte/word in AL/AX register.
Operation:-
When source is BYTE  then, AX←  AL* signed 8-bit source
When source is BYTE  then, DX: AX←  AX* signed 16-bit source

Which flags get affected?
Ans- OF , CF, PF , AF, SF , ZF .


data segment
no1 dw 21h
no2 dw 31h
ans dw ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
mov ax , no1
mov bx , no2
MUL  bx 
AAM
LEA si , ans
mov [ si ] , ax
mov [ si+2 ] , dx
mov ah ,4ch
int 21h
code ends
end start


Programs:-


For many other Assembly Language  Programs related to microprocessor 8086 visit our  BLOG 

There are programs of largest ,smallest ,division ,multiplication,odd/even,block operation ,string operations,BCD ,etc

No comments:

Post a Comment