In general we do not do your class work for you here. That would result in you learning less. I will help you to understand the problem. Are you allowed to use existing hardware or software ?
Read and understand the definition for Modbus at
https://en.wikipedia.org/wiki/Modbus
If you need to build your own hardware then the project has two parts. The first is building the hardware RS485 interface. The next is providing the modbus software to run on the processor that talks over the RS485 network.
A good introductory article on RS485 networks can be found at
Designing RS-485 Circuits
Modbus is a serial communications protocol. You will need software to create and parse Modbus packets. Modbus packets take one of two forms. Modbus RTU is a compact, binary representation of the data. Modbus ASCII is human readable, and more verbose. Figure out which one you need to use. What are the constraints.
The packets are sent and recievied by the 89c51's UART. The uart has RX (read) and TX (write) lines that operate at TTL levels. You most often see these connected to RS232 level shifters but you will not be doing so.
Instead connect the uart to a ST485 or similar RS485 interface chip. You will need to use a output pin from the processor to generate the transmitter enable signal for the ST485.
Keep in mind that the UART is capable of full duplex but the ST485 is half duplex.
When you understand all this talk to you instructor to see if you are on the right track.
I would be happy to answer questions about YOUR design. You will get a lot more out of this if you do your own work.
3v0