PhysicsTeacher.in

High School Physics + more

RLC and RAL instructions in 8085

Last updated on May 17th, 2022 at 04:08 pm

Instructions RLC and RAL are basically two logical instructions available in 8085 instruction set, to rotate the bits of the accumulator one position to the left.

Now to understand the difference between RLC and RAL instructions, their functions are explained with diagrams first and then with some numerical examples.

Difference between RLC and RAL instructions in 8085

RLC: Rotate the accumulator left. Bit 7 goes to both Bit 0 and the Carry flag CY.

RAL: Rotate the accumulator left through the carry. Bit 7 goes to the carry flag (CY) and carry goes to Bit 0.

Fig.1 shows the difference in RLC and RAL for left shift operation.

Fig.1 shows the difference in RLC and RAL for left shift operation.

Explain the function of RLC with an example

Question 1) What will be the content of the accumulator and the status of CY flag after RLC operation, if the content of the accumulator is BCH and CY is 0?

Content of accumulator (ACC) is BCH= (1011 1100)2

Status of accumulator and carry flag before execution of instruction RLC

Status of Carry Flag:

Accumulator content

How RLC rotates the bits of the accumulator one position to the left

Fig.2. RLC Rotates the bits of the accumulator one position to the left.

Fig.2. RLC Rotates the bits of the accumulator one position to the left.

Status of accumulator and carry flag after execution of instruction RLC

Status of Carry Flag

Accumulator content

Answer:

Now after execution of instruction RLC one time, the content of accumulator (ACC) is (0111 1001)2= 79H and the Carry flag is SET i.e. CY=1

Explain the function of RAL with example:

Question 2) What will be the content of the accumulator and the status of CY flag after RAL operation, if the content of the accumulator is BCH and CY is 0?

Content of accumulator (ACC) is BCH= (1011 1100)2

Status of accumulator and carry flag before execution of instruction RLC

Status of Carry Flag

Accumulator content

How RAL rotates the bits of the accumulator one position to the left through carry

Fig3. RAL Rotates the bits of the accumulator one position to the left through carry.

Fig3. RAL Rotates the bits of the accumulator one position to the left through carry.

Status of accumulator and carry flag after execution of instruction RAL

Status of Carry Flag

Accumulator content

Answer:

Now after execution of instruction RAL one time, the content of accumulator (ACC) is (0111 1000)2= 78H and the Carry flag is SET i.e. CY=1

Author of this post

This post is co-authored by Professor Saraswati Saha, who is an assistant professor at RCCIIT, a renowned degree engineering college in India. Professor Saha teaches subjects related to digital electronics & microprocessors.

See also  Pin functions of 8085 microprocessor
Scroll to top
error: physicsTeacher.in