Hi Guys, I have a very basic question about the 'RRF' command, for a program using a 16F627. I am using RB1,2,3,4 to read a DIP switch to choose 1 of 16 different outcomes. (RB0 is being used as an external interrupt otherwise it wouldn't be a problem) I want to read the switch ... 'RRF' the result to scrub off the least significant bit ... then use that result (a number between 1 - 16 ) to offset the program counter etc. I'm not sure of what I can 'operate' on ... Can I use ... rrf portb,w ; remove the least sig bit ... or does that mess with portb as well ... which has actual switches on it. Then ... andlw b'00001111' ; only keep the 4 lowest bits addwf pc,f ; add offset to prog counter ... or do I have to read the port, move it into a seperate file register .. 'RRF' that ... then move the result into 'w' to offset the program counter ? ... or alternatively, can I 'RRF' 'W' and put the result in 'W' ? I would have assumed the last one would be possible, but I cant find any examples of it, so have been wondering. Thanks for any help. Regards, Roger -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist