motion
New Member
I have a question about the rlf, that is a rotate left shift correct?
It is "Rotate Left f through Carry". It's in the PIC16F84 datasheet.
Wouldn't that be different than a regular left shift which I need to perform?
I don't know where you're coming from but in the PIC16F84 instruction set, RLF is the only "regular left shift" instruction. My advice is to try to understand what RLF exactly does and code accordingly. Don't get hung up on another processor's instruction set.
Anyway, I normally group the code in bunches so that is best undestood within that context. I also separate the groups by the comment character ';'. It is the same character that terminates a line of code in C.
The code group:
Code:
bcf status,C
rlf entered_pass_code,f
bcf status,C
rlf entered_pass_code,f
;
can also be coded as follows with the same result:
Code:
rlf entered_pass_code,f
rlf entered_pass_code,f
movlw b'11111100'
andwf entered_pass_code,f
;