Showing posts with label division. Show all posts
Showing posts with label division. Show all posts

Tuesday, December 21, 2021

8086 Assembly Program to Divide Two 16 bit Numbers

8086 program to divide 2 16 bit numbers- 8086 16Bit division assembly program

data segment

num1 dw 2800h

num2 dw 0002h

result1 dw ?

data ends

code segment

start :

assume cs:code, ds:data

mov ax,data

mov ds,ax

mov ax,num1

mov bx,num2

div bx

mov result1,ax

mov ah,4ch

int21h

code ends

end start

Block transfer OVERLAPPING 
Block transfer(Simple Program)
Block Transfer(REVERSE ORDER)
Addition of 8-bit  BCD8086 program
addition of 16-bit bcd program
Division of 32/16 bit program
Subtraction of 8-bit program
Subtraction of 8-bit BCD program
Subtraction of 16-bit program
Subtraction of 16-bit BCD program
String reverse 8086 program
block transfer using string
string concatenation
string length calculation
Block Transfer 
Block reverse
Hex to ASCII program 8086
BCD to ASCII program 8086
ASCII to BCD program 8086

Programs:-

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

Monday, October 25, 2021

8086 program to divide two 8 bit hexadecimal numbers

 8-bit hexdecimal numbers division in 8086 assembly program

data segment

n1 db 50h

n2 db 05h

data ends

code segment

start :

assume cs:code, ds:data

mov ax,data

mov ds,ax

mov al,n1

mov bl,n2

div bl

mov ah,4ch

int 21h

code ends

end start

Block transfer OVERLAPPING 
Block transfer(Simple Program)
Block Transfer(REVERSE ORDER)
Addition of 8-bit  BCD8086 program
addition of 16-bit bcd program
Division of 32/16 bit program
Subtraction of 8-bit program
Subtraction of 8-bit BCD program
Subtraction of 16-bit program
Subtraction of 16-bit BCD program
String reverse 8086 program
block transfer using string
string concatenation
string length calculation
Block Transfer 
Block reverse
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 , etc and MSBTE diploma,BCA,MCA and engineering related concepts visit our  BLOG

Wednesday, June 3, 2020

Assembly Program to DIVISION two16-bit number by 8-bit numbers 8086 ( signed and unsigned)

Hello!

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

DIV:- It  divides unsigned/signed word(16bit) by unsigned/signed byte(8bit) . Quotient is stored in AL  and remainder stored in AH register.

IDIV:-  It  divides signed word(16bit) by signed byte(8bit) . Quotient is stored in AL  and remainder stored in AH register.

Below are programs for signed division and unsigned division of 16bit/8bit in 8086....

A) Unsigned 8086 Program:-

data segment
no1 dw 21h
no2 db 31h
q db ?
 db ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
mov ax , no1
DIV  no2
mov  q , al
mov r , ah
mov ah ,4ch
int 21h
code ends
end start


B) Signed Division 8086 Program:-

data segment
no1 dw 21h
no2 db 31h
q db ?
 db ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
mov ax , no1
IDIV  no2
mov  q , al
mov r , ah
mov ah ,4ch
int 21h
code ends
end start

32/16 bit DIVISION 8086 Program Code - for Signed and Unsigned Both

Programs:-

For many other Assembly Language  Programs related to microprocessor 8086, data structures  and C++ visit our  BLOG 
There are programs of largest ,smallest ,division ,multiplication,odd/even,block operation ,string operations ,etc

Assembly Language Program to DIVISION two 32-bit / 16 –bit signed numbers 8086(signed)

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

DIV:- It  divides unsigned/signed double-word(32bit) by unsigned/signed word(16bit) .

IDIV:-  It  divides signed double-word(32bit) by signed word(16bit) . 

Signed 32/16 bit division:-
data segment
no1 dd 02h          
no2 dw 03h
q dw ?
r dw ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
lea si , no1
mov ax, [ si ]
mov dx,[ si+2 ]
IDIV no2
mov q , ax
mov r , 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 ,et

Monday, May 20, 2019

Assembly Language Program to DIVISION two 32-bit / 16 –bit numbers 8086 (signed and unsigned)

(For many other Assembly Language  Programs related to microprocessor 8086, data structures and C++ visit our  BLOG )

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

DIV:- It  divides unsigned/signed double-word(32bit) by unsigned/signed word(16bit) .

IDIV:-  It  divides signed double-word(32bit) by signed word(16bit) . 

Below are programs for unsigned and signed division of 32-bit/16-bit:-
a) Unsigned:
data segment
no1 dd 02h
no2 dw 03h
q dw ?
r dw ?
data ends
code segment
start : assume  cs :code,  ds :data
mov ax ,data
mov ds , ax
lea si , no1
mov ax, [ si ]
mov dx,[ si+2 ]
DIV no2
mov q , ax
mov r , dx
mov ah ,4ch
int 21h
code ends
end start

b) Signed 32-bit/16-bit  program 8086 . (Click on the Link for detailed program code.)