- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- 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 reverse 8 bit number
In this program we will see how to reverse the digits of an 8-bit number using 8085.
Problem Statement
Write 8085 Assembly language program to reverse an 8-bit number stored at location 8000H. Also, store the result at 8050H.
Discussion
Here the task is too simple. There are some rotating instructions in 8085. The RRC, RLC are used to rotate the Accumulator content to the right and left respectively without carry. We can use either RRC or RLC to perform this task.
Input
Address | Data |
---|---|
… | … |
8000 | 4C |
… | … |
Flow Diagram
Program
Address | HEX Codes | Labels | Mnemonics | Comments |
---|---|---|---|---|
F000 | 3A, 00, 80 | | LDA 8000H | Take the number from memory |
F003 | 0F | | RRC | Rotate right without carry four times |
F004 | 0F | | RRC | |
F005 | 0F | | RRC | |
F006 | 0F | | RRC | |
F007 | 32, 50, 80 | | STA 8050H | Store the result at memory |
F00A | 76 | | HLT | Terminate the program |
Output
Address | Data |
---|---|
… | … |
8050 | C4 |
… | … |
Advertisements