If you work on PIC or motorola, 8051 input pin may be strange to you.
Unlike the others, there is no port direction control register. You cannot set the I/O to be input permenantly.
In 8051, if you want to read an I/O pin, you must first set the value to be 1. So, it the input is 1, it remain to be 1. If input is 0, then it will pull down the I/O to 0. After that, if you wish to read again, you gotta reset the I/O to 1.
That is somehow confusing and troublesome.