I am working on a small initial project where I would like to read a six-position dip switch on RA0 to RA5.
My intention is to assign RA0-RA3 to BYTE variable SW4 and RA4-RA5 to variable SW2. I have been able to load all six bits RA0-RA5 into SW4 using:
Is there a way to only load bits RA0-RA3 into SW4, or is the best way to mast out bits 4 and 5 after loading the variable? And doing the same when I load the last two bits into SW2 and just mask out bits 0-3?Code:SW4 = PORTA
I thought I had seen a variation of setting variable to only include certain bits, but unable to find that reference now.
Thoughts?
Thanks..
Bookmarks