Hi, in a serial communication program, do I have to "SETB P3.0" in order to receive from the serial port ??
"how the 8051 Quasi-Bidirectional port pins work"
for signaling purposes (low current), you can easily write all your code, pretending that there is a direction register on the 8051. for example, all the code I have written sets a _DDR register, even for 8051.
this allows me to write code that works for a variety of chips, including the 8051.
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.