[SOLVED] What is the assembly instruction to shift right for pic16F84A

Status
Not open for further replies.

bimalkamal

Member level 1
Joined
Nov 27, 2011
Messages
32
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,529
Suppose my PORTB register contains decimal 128(Hex0x80)

now in a loop the value must change like:- 128->64->32->16->8->4->2->1

Divide by 2 or shift left operation is needed.what to do?


RRF PORTB,1 instruction changes like this:-
(Bits shown)
10000000->11000000->11100000->11110000->11111000->.....->11111111 so, it is not what I want
 

Clear the carry bit before you do the each RRF instruction.
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…