Hi, in a serial communication program, do I have to "SETB P3.0" in order to receive from the serial port ??
Yes - so long as you're clear that you're just pretending!
Some modern 8051 derivatives also have (the option of) ports with a real direction register...
"for example, all the code I have written sets a _DDR register, even for 8051"
How does that work when you "set" the pretend DDR for output?
"How does that work when you "set" the pretend DDR for output?"
nothing. absolutely nothing.
So your code doesn't just "set a DDR register" - you need a macro (or macros) that expands to one thing to select "input" mode, and to nothing at all to select "output" mdoe?
depending on the target, the code, macros or calls, may do something, or different things, or nothing at all.
and the 8051 happens to be the platform where the code does absolutely nothing.