You are going to need certain tools that are a must....
You need to have a compiler..... assember, basic, C.... for the langague you chose to use.
Then you are going to need a programmer like the EPIC..... so that you can download to the PIC the program you wrote
Depending on each program you read and store ports pins....
You don't actually mention what sort of value it is you want to read, do you just mean reading a digital value from a port, or reading an analogue value. The first is extremely trivial, the simplest thing you could possibly do with a PIC - the second is pretty easy, but takes a few more lines.
However, even in the first case, you will need to perform various setup procedures on the chip, these will be a great deal longer than the reading itself.
For example in PICBASIC PRO all you do is define a variable and assign the port you want to read to that variable.... or simply read the register for the port.
DIM myVar as Byte
MyVAr = PortB ' Now myVar will have the value of RB7-RB0
To be able to read inputs you havve to set the "direction" register, which is TRISB for PortB. Then you can assign which pin are inputs and which are outputs.
What you need is a tutorial for the program you want to use...... PICBASIC is probably the easiest and quickest to learn.
me-electro u can never underestimate the info u get fron the datasheet, it seems easy to ignore at first, but eventually u will have to read some of it!
The 16F877 has an 8 channel 10 bit S/A A/D convertor, should u require the reading of an analog signal, this should be used. If it is digital then u will need to understand how to either transmit or receive data from the various pins u choose and again, this goes back to reading the spec. sheet unfortunately...