- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
8085 program to exchange content of HL register pair with DE register pair
In this program we will see how to exchange the content of DE and HL pair.
Problem Statement
Write 8085 Assembly language program to swap the content of HL and DE register pair.
Discussion
This process is very simple, 8085 has XCHG instruction. This instruction swaps DE and HL pair content. We are storing some values to DE and HL pair directly, and then exchange them using XCHG.
Input
DE = 5678H HL = CDEFH
Flow Diagram
Program
Address | HEX Codes | Mnemonics | Comments |
---|---|---|---|
F000 | 16, 56 | MVI D,56H | Load D with56H |
F002 | 1E, 78 | MVI E,78H | Load D with78H |
F004 | 26, CD | MVI H,CDH | Load D with CDH |
F006 | 2E, EF | MVI L,EFH | Load D withEFH |
F008 | EB | XCHG | Exchange the content of DE and HL |
F009 | 76 | HLT | Terminate the program |
Output
DE = CDEFH HL = 5678H
- Related Articles
- 8085 program to access and exchange the content of Flag register with register B
- Register codes of 8085 Microprocessor
- Flags register in 8085 Microprocessor
- Register addressing mode in 8085 Microprocessor
- Instruction register (IR) in 8085 Microprocessor
- Temporary (temp) register in 8085 Microprocessor
- 8085 program to count the number of ones in contents of register B
- Accumulator or Register A in 8085 Microprocessor
- Register indirect addressing mode in 8085 Microprocessor
- 8085 program to find 2's complement of the contents of Flag Register
- How to de-register a driver from driver manager’s drivers list using JDBC?
- Control register of 8257
- Status register of 8257
- How to create a register form with CSS?
- 8085 Program to Exchange 10 bytes

Advertisements