In pic microcontroller TRIS register determines whether port would act as input or output and PORT register would determine the content, what should be written (in case of output) or read (in case of input).
But in 8051 there isn't any such kind of TRIS register. To configure the register as input/output you have to write to the same register and to write/read the data you have to use the same register again. Am I right about this? If yes, then please explain how is it possible? If not, then please explain the correct theory about this.