Wednesday, June 16, 2021

8086 Program to Multiply two 16 bit numbers

 

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 .

 

8086 program to Multiply two 16-bit BCD number:-

data segment

n1 dw 6600h

n2 dw 0006h

res dw ?

data ends

code segment

start:

assume cs:code ds:data

mov ax,data

mov ds,ax

mov ax,n1

mov bx,n1

mul ax

aam

mov ah,4ch

int21h

code ends

end start

 

Hex to ASCII program 8086
BCD to ASCII program 8086
ASCII to BCD program 8086
BCD to HEX
HEX to BCD

  


Programs:-

For many other Language Programs of microprocessor 8086, C++ , Data Structures and MSBTE diploma ,BCA,MCAand engineering related concepts visit our  BLOG

No comments:

Post a Comment