- Trending Categories
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
Instruction type RAR in 8085 Microprocessor
In 8085 Instruction set, RAR stands for “Rotate Accumulator Right involving Cy flag in rotation”. It rotates the Accumulator contents to the right by 1-bit position. From the following Fig. we are getting the operation details.

From the Fig. we can see that, during right rotate the least significant bit is coming out and will be copied on the Cy flag bit and the previous Cy flag bit will be moved to the most significant bit position of the Accumulator. It is 1-Byte instruction. And it is 9-bit rotation of Accumulator and Cy contents. Only Cy flag is affected by this instruction execution.
Mnemonics, Operand | Opcode(in HEX) | Bytes |
---|---|---|
RAR | 1F | 1 |
This instruction can be used in multiple case studies.
After rotate as the least significant bit of the Accumulator is getting copied to Accumulator, so we can check its value and can infer whether Accumulator was holding even or odd values.
It can be used to perform division by 2. We know that Accumulator’s content will have n-bits right shift if we divide the Accumulator by 2n.
To insert a new bit value at the most significant bit position, putting this bit value in the Cy flag and then executing this instruction.
With the help of following examples, we can understand the operation better.
Example 1
Before | After | |
---|---|---|
(A) |
8AH | 45H |
(Cy) |
0 | 0 |
8AH ---> 1000 1010 0100 0101 ---> 45H (Last bit 0 is copied to Cy bit) (And initial Cy=0 bit at the MS place)
Address | Hex Codes | Mnemonic | Comment |
---|---|---|---|
2004 | 1F | RAR | Rotate Accumulator Right |
Note that Accumulator value is halved.
Example 2
Before | After | |
---|---|---|
(A) |
8AH | C5H |
(Cy) |
1 | 0 |
8AH ---> 1000 1011 1100 0101 --->C5H (Last bit 1 is copied to Cy bit) (And initial Cy=1 bit at the MS place)
Address | Hex Codes | Mnemonic | Comment |
---|---|---|---|
2003 | 1F | RAR | Rotate Accumulator Right |
Note that Accumulator value is not halved in this case because Cy=1 before rotation.
The timing diagram against this instruction RAR execution is as follows −

Summary − So this instruction RAR requires 1-Byte, 1-Machine Cycle (Opcode Fetch) and 4 T-States for execution as shown in the timing diagram.
- Related Articles
- Instruction type CMC in 8085 Microprocessor
- Instruction type STC in 8085 Microprocessor
- Instruction type RLC in 8085 Microprocessor
- Instruction type RAL in 8085 Microprocessor
- Instruction type RRC in 8085 Microprocessor
- Instruction type SPHL in 8085 Microprocessor
- Instruction type XTHL in 8085 Microprocessor
- Instruction type NOP in 8085 Microprocessor
- Instruction type XCHG in 8085 Microprocessor
- Instruction type INR R in 8085 Microprocessor
- Instruction type ADC R in 8085 Microprocessor
- Instruction type ACI d8 in 8085 Microprocessor
- Instruction type SUB R in 8085 Microprocessor
- Instruction type SUI d8 in 8085 Microprocessor
- Instruction type DCR R in 8085 Microprocessor
