I want to make sure that Im right the codes espeically RLC:
Code:
SIGNAL EQU P1.0;
LOOP: MOV B,#8
MOV A,#FFH
RLC A
MOV SIGNAL,C
DJNZ B,LOOP
I understand that C denotes as Carry so every loop, the single on the left of A (FF#) will be shifted and the bit will be stored in the Carry bit.
What happen to the right bit? will zero appear in the far right end of the A?
Thus before receiving the bit 7 of Accumulator, the Carry flag send his value to bit 0 of Accumulator.
Obvious during RLC the bits inside A are shifted one position to the left.
If Carry hold "0" before the first movement, that's why you see the "0" filling the Accumulator from the right