8051 Open Drain Operation
Keep in mind that "open-drain" means that if you write a 0 to a pin, it will be forced to zero, but if you write a 1, then the pin will take on whatever state is determined by the external connection. The combination of the two for each pin is what you get when you read the port.