You can program 8051 to act as 8255 PIA ..
To control 8255 you need 11 lines: /RD, /WR/ A0, A1 and D0-D7 ..
All what you have to do is to program 8051 to read from (or to write to) multiplexed address/data bus .. if you know how it works it shouldn't be difficuit ..
Once you have this, take commands used by a microcontroller to controll 8255 and write procedures in 8051 to act identically ..
For example, to set pin PC0 8255 receives a command consisting of address of the controll register followed by direct bit set/clear command ..
Address is locked in the 8255 on falling edge of /WR and command goes into it on the rising edge of /WR .. and that is what 8051 should be "taught" to do ..
You can select Int0 and INt1 as /RD and /WR, any general purpose I/O as A0 and A1, and any available 8-bit port to act as 8-bit multiplexed address/data bus ..
Regards,
IanP