assigning port values in c in 89c51
On Power On Reset 8051 internal registers are initialised with all interrupts and peripherals are disabled . So u dont need to initialise when all the 4 ports are used only as I/o lines.
given below is taken from atmel 89C51 datasheet
Ports 0 has open-drain outputs. Each I/O line can be independently used as an input or an output. (Ports 0 and 2 may not be used as general purpose I/O when being used as the ADDR/DATA BUS). To be used as an input, the port bit latch must contain a 1, which turns off the output driver FET. Then, for Ports 1, 2, and 3, the pin is pulled high by the internal pull-up, but can be pulled low by an external source.