- 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 RAL in 8085 Microprocessor
In 8085 Instruction set, there is another mnemonic RAL,which stands or Rotate Accumulator Left and also involving Cy flag in rotation. It rotates the Accumulator contents to the left by 1-bit position. The following Fig. is depicting the execution logic of the instruction.
From the Fig. we can see that the due to left rotation the bit which is coming out from the most significant place will be copied to the Cy flag bit. And the previous Cy bit will be moved to least significant bit place of the Accumulator. Thus it is a 9-bit rotation of Accumulator and Cy contents. Only Cy flag is affected by this instruction execution.
Mnemonics, Operand | Opcode(in HEX) | Bytes |
---|---|---|
RAL | 17 | 1 |
The instruction can be used for multiple purposes.
To find the most significant bit of the Accumulator, performing rotate left.
To perform multiplication by 2. We know that if we multiply a number by 2n then the number will have n-bit left rotation.
As during rotation, an empty space will get created. So to put a new bit at that least significant space we can use this mnemonic as well.
Let us consider the following examples for the better understanding.
Example 1
35H ---> 0011 0101 0 0110 1010 ---> 6AH (Prev. Cy bit as the Last bit)
Before | After | |
---|---|---|
(A) | 35H | 6AH |
(Cy) | 0 | 0 |
Address | Hex Codes | Mnemonic | Comment |
---|---|---|---|
2003 | 17 | RAL | RotateAccumulator Left |
Note that Accumulator value has been doubled compared with the previous value.
Example 2
35H ---> 0011 0101 0 0110 1011 ---> 6BH(Prev. Cy bit as the Last bit)
Before | After | |
---|---|---|
(A) | 35H | 6BH |
(Cy) | 1 | 0 |
Address | Hex Codes | Mnemonic | Comment |
---|---|---|---|
2003 | 17 | RAL | RotateAccumulator Left |
Here the current Accumulator content is not doubled compared to the initial content of the Accumulator. As in this case because most significant bit of Accumulator was a 1 before rotation.
The timing diagram against this instruction RAL execution is as follows −
Summary − So this instruction RAL requires 1-Byte, 1-Machine Cycle (Opcode Fetch) and 4 T-States for execution as shown in the timing diagram.
- Related Articles
- Instruction type XCHG in 8085 Microprocessor
- Instruction type CMC in 8085 Microprocessor
- Instruction type STC in 8085 Microprocessor
- Instruction type RLC in 8085 Microprocessor
- Instruction type RRC in 8085 Microprocessor
- Instruction type RAR in 8085 Microprocessor
- Instruction type SPHL in 8085 Microprocessor
- Instruction type XTHL in 8085 Microprocessor
- Instruction type NOP in 8085 Microprocessor
- Instruction type LDA a16 in 8085 Microprocessor
- Instruction type STA a16 in 8085 Microprocessor
- Instruction type LDAX rp in 8085 Microprocessor
- Instruction type STAX rp in 8085 Microprocessor
- Instruction type LHLD a16 in 8085 Microprocessor
- Instruction type SHLD a16 in 8085 Microprocessor
