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


Updated on: 30-Jul-2019

737 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements