Showing posts with label Multiply. Show all posts
Showing posts with label Multiply. Show all posts

Thursday, June 17, 2021

8086 PROGRAM TO MULTIPLY TWO 8-BIT BCD NUMBER


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 Assembly program to multiply two 8-bit BCD number

data segment

n1 db 30h

n2 db 03h

res db ?

data ends

code segment

start:

assume cs:code ds:data

mov ax,data

mov ds,ax

mov al,n1

mov bl,n1

mul al

aam

mov ah,4ch

int21h

code ends

end start 

Programs:-

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

 

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

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

Wednesday, June 3, 2020

8086 Assembly Language for multiplication of 2 8-bit nos

For many other Assembly Language  Programs related to microprocessor 8086, c, c++, and more  visit our  BLOG 

Program to MULTPLY two 8-bit  BCD numbers :-
data segment
no1 db 02h
no2 db 03h
ans db ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
mov al , no1
mov bl ,no2
MUL  b1
AAM
mov ans ,al
mov ah ,4ch
int 21h
code ends
end start




Programs:-

For many other Assembly Language  Programs related to microprocessor 8086, programs of c++, vb. Net and more  visit our  BLOG 
There are programs of largest ,smallest ,division ,multiplication,odd/even,block operation ,string operations,BCD ,etc


Monday, May 27, 2019

Assembly 8086- program to multiply two 16-bit nos

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 db 02h
no2 db 03h
ans db ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
mov al , no1
mov bl ,no2
imul  b1
mov ans ,al
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 ,etc

Thursday, May 16, 2019

8086 Assembly program to MULTIPLY two signed 8-bit numbers using SIGNED method

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 db 02h
no2 db 03h
ans db ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
mov al , no1
mov bl ,no2
imul  b1
mov ans ,al
mov ah ,4ch
int 21h
code ends
end start

Programs:-


For many other Assembly Language  Programs related to microprocessor 8086 , etc subjects related to MSBTE,Computer engineering, IT ...visit our  BLOG 

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

Wednesday, May 15, 2019

8086 Assembly Program to MULTIPLY two 8-bit numbers(signed and unsigned)

Hey Guys!! Today we will see 8086 program to multiply two 8-bit number using the signed and unsigned method. Before proceeding let's see and understand the theory first and then move further with the program. 


Let's go!!



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 .



Unsigned:- 

data segment
no1 db 02h
no2 db 03h
ans db ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
mov al , no1
mov bl ,no2
MUL  b1
mov ans ,al
mov ah ,4ch
int 21h
code ends
end start

Signed:-

data segment
no1 db 02h
no2 db 03h
ans db ?
data ends
code segment
start : assume cs :code, ds :data
mov ax ,data
mov ds , ax
mov al , no1
mov bl ,no2
imul b1
mov ans ,al
mov ah ,4ch
int 21h
code ends
end start

Programs:-


For many other Assembly Language  Programs related to microprocessor 8086, etc subjects related to MSBTE, Computer engineering, IT field visit our  BLOG 
There are programs of largest ,smallest ,division ,multiplication,odd/even,block operation ,string operations ,etc