Please be aware that the P87C51RD2BA is no longer manufacturer as is shown on the next link
https://www.nxp.com/part/P87C51RD2BA#/
Because of this, this family is no longer supported.
Please let me know if you need any recommendations, but there is not pin a pin-compatible device