Home »
Embedded Systems
Reverse an 8-bit Number in 8085 Microprocessor
In this tutorial, we will learn how to reverse an 8-bit number in 8085 Microprocessor?
By Akash Kumar Last updated : May 13, 2023
Reverse an 8-bit Number in 8085 Microprocessor
Given an 8-bit number, we have to reverse the given number in 8085 Microprocessor.
Algorithm
- Load the accumulator with the first data.
- Use RLC instruction to shift contain of accumulator by 1 bit without carry. Use this 4 times to reverse the contain of accumulator.
- Now load the result value in memory location.
Program
LDA 2050
RLC
RLC
RLC
RLC
STA 3050
HLT
Observation
INPUT:
2050:05
OUTPUT:
3050:50
Hence, we successfully reversed 8 bits number.