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-bit numbers using Direct addressing mode | 8085 Microprocessor



Here, we are going to learn how to swap two 8-bit numbers using direct addressing mode?
Submitted by Akash Kumar, on November 06, 2018

Problem statement:

Write a program to swap two 8-bit numbers using direct addressing mode on 8085 microprocessor.

Algorithm:

  1. Load first number to the accumulator.
  2. Move the first number to register H.
  3. Load second number to the accumulator.
  4. Move the second number to register D.
  5. Exchange the content both the register pair.
  6. Terminate the program.

Program:

	LDA     2050
	MOV     H, A
	LDA     2051
	MOV     D, A
	XCHG
	HLT

Observation:

    INPUT: 
    2050:07
    2051:04

    OUTPUT: 
    2050: 04
    2051: 07 

Hence we successfully swapped two 8 bit number using direct addressing mode.






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.