- Back to Home »
- Programming »
- RLC, RRC, RAL, RAR, CMA, CMC, STC

**1. RLC: -**Each binary bit of the accumulator is rotated left by one position. Bit D7 is placed in the position of D0 as well as in the Carry flag. CY is modified according to bit D7. Any other bit is not affected.

Eg: - RLC

Eg: - RLC

**2. RRC: -**Each binary bit of the accumulator is rotated right by one position. Bit D0 is placed in the position of D7 as well as in the Carry flag. CY is modified according to bit D0. Any other bit is not affected.

**Eg: - RRC**

**3. RAL: -**Each binary bit of the accumulator is rotated left by one position through the Carry flag. Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant position D0. CY is modified according to bit D7.

**Eg: - RAL**

**4. RAR: -**Each binary bit of the accumulator is rotated right by one position through the Carry flag. Bit D0 is placed in the Carry flag, and the Carry flag is placed in the most significant position D7. CY is modified according to bit D0.

**Eg: - RAR**

**5. CMA: -**The content of accumulator is complemented.

**Eg: - CMA**

**6. CMC: -**The carry flag is complemented.

**Eg: - CMC**

**7. STC: -**This instruction sets the carry flag

**.**

**Eg: - STC**

difference between RLC and RAL

ReplyDeleteboth are bored one so no need tat

Deletein rlc the left most bit d7 is shifted to carry flag and right most bit i.e.., same binary bit is shared by carry as well as in d0. but in the case of ral the bit in d7 is transferred to carry flag and the previous stored carry flag is shifted to d0. hope thats clear

Deletein RAL it is supposed that data is of 9 bit D0 to D7 in addition the carry, so when RAL is executed D7 is placed in CY and Cy bit is placed in D0,

DeleteIn the other hand RLC is the the circulation is done only between DO to D7

shaik azar badu

ReplyDeletein rlc d7->carry and d7->d0

ReplyDeletein ral d7->carry and carry->do

in rlc d7->carry and d7->d0

ReplyDeletein ral d7->carry and carry->do

can anyone tell how exactly does RAL work when the data in the accumulator is [08]?

ReplyDelete08 is written as 0000 1000 if carry flag is initially reset(0) then including carry flag the number 08 can be written as

Delete0 0000 10000 (the left most bit is carry ) now shift each bit to the left then carry bit goes to the rightmost and the left most 0 of 0000 comes in place of carry and the number becomes:

0 0001 0000

But if carry bit was initiall set i.e 1 the number 08 with carry bit would be

1 0000 10000 (the left most bit is carry )

after RAL it would be :

( every bit would be shifted to left and the left most 1 would come to the rightmost)

0 0001 0001

it became very helpful,good

DeleteDifference between Reset out and Intr

ReplyDeleteWhat is the addressing mode of CMC & STC instructions

ReplyDeleteThank you so much, really helped me a lot in preparing for my exams.

ReplyDelete