Quick links
Latest articles
Internship
Members
New...
Algorithms
Discrete Mathematics
Big data
Languages
C
C++
C++ STL
Java
Data Structure
C#.Net
Android
Kotlin
SQL
Web
PHP
Python
JavaScript
CSS
Ajax
Node.js
Web prog.
Programs
C
C++
DS
Java
C#
Python
Aptitude
C
C++
Java
DBMS
Interview
C
Embedded C
Java
SEO
HR
CS Subjects
CS Basics
O.S.
Networks
DBMS
Embedded Systems
Cloud Computing
Machine learning
CS Organizations
Linux
DOS
More...
Articles
Puzzles
News/Updates

Home » Embedded Systems

Swap Two 8 bits numbers | 8086 Microprocessor



Here, we are going to learn how to swap two 8 bits numbers using 8086 Microprocessor?
Submitted by Akash Kumar, on November 03, 2018

Problem statement:

To swap two 8 bits numbers using third register on 8086 microprocessor.

Algorithm:

  1. Load first number in register AL through memory.
  2. Move the content of register AL in register BL.
  3. Load the second number in register AL through memory.
  4. Store the content of register AL at the memory location of first number.
  5. Store the content of register AL at the memory location of second number.
  6. Terminate the program

Program:

	MOV     AL, [0600]
	MOV     BL, AL
	MOV     AL, [0601]
	MOV     [0600], AL
	MOV     [0601], BL
	HLT

Observation:

    INPUT: 
    0600:05
    0601:04

    OUTPUT: 
    0600:04
    0601:05

Hence we successfully swapped 2 8 bits using third register on 8086 microprocessor.






Quick links:
C FAQ(s) C Advance programs C/C++ Tips & Tricks Puzzles JavaScript CSS Python Linux Commands PHP Android Articles More...

Featured post:
Introduction to Linux (Its modes, Safety, Most popular Applications)
Linux Best Distribution Software (Distros) of 2018

Was this page helpful? Please share with your friends...

Are you a blogger? Join our Blogging forum.

Comments and Discussions



Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates



© https://www.includehelp.com (2015-2018), Some rights reserved.