Hi experts,
I would like to create a physically changable but otherwise static byte variable by using an 8 pin DIP switch for a 16f877a to "read." (Apply 5V from a common rail to the pins for "ON")

So, I'd like to set the DIP before power-on to, say, 01111111 to represent the number 127, which will be a critical element but not change for the remainder of the program unless I reset or do some other interrupt. (A hidden away "field changeable" property without the need for displays, etc.)

Such that the pins on/off will create a variable in the range from 0-255.

Assuming I have all the pins set to digital, et al, I can't think of how to place the bits from the pins into place.

This has to be so simple I'll be embarrased, but can anyone clue me in?

Thanks

Chris