Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Doubt in the rotation asm pic16F

Status
Not open for further replies.

aless2056

Member level 1
Joined
May 11, 2020
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Activity points
338
Guys, I'm a beginner and I'm in doubt in the RRF Rotation instruction. Assuming I have this value

0000 0011 0011 1100
AH = 0000 0011
AL = 0011 1100

Did I do that?

RRF AH, F
RRF AL, F
RRF AH, F
RRF AL, F

Will the result be?

AH = 0000 0000
AL = 1100 1111
 

Hi,

The answer is: it depends.

I don't want to do your homework.
So please show the states after each commend. Step by step.


Klaus
 

You should study the data sheet, it explains all the instructions and gives examples.

'AH' and 'AL' presumably are register names and independent 8-bit values.
RRF AH, F AH is 0000 0011 before the instruction so rotating it right through the carry flag, bit 7 = whatever was in C, and C becomes what was in Bit 0
The same applies to the AL register but note there is only one carry bit so it may transfer a bit from one register to the next.

We can't predict what the result will be without knowing what was in C at the outset.

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top