bimalkamal
Member level 1
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
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