master slave networks
First of all, I would rather connect the RS-485 to the second UART (Port3) then trying to mix/multiplex both serial strings.
I assume that communication with PC will be controllerd within 89C450 by serial port interrupt with some kind of Rx buffer and Tx buffer (examples of code on this are available).
To communicate with SLAVES address them at your wish, for example 1, 2 ,3 ,4 and 5.
You can create a command string which may look like this: <address, command data, XOR checksum>,
where:
< is left delimiter 3Ch treated as the START character ..
address of slave 1 =01h, slave 2=02h ...
command data is a series of bytes required to ask for data
XOR checksum is juts XOR of all bytes in this string excluding/including itself
In response each slave will send a string which again may start with < (delimiter 3Ch, followed by its addres (01h, 02h, ..) , followed by data, followed by XOR checksum of all characters in this string ..