The major difference between 52 and 2051 is in their physical size: 52 is 40-pinner, 2051 is 20-pinner ..
Translating from 51/52 to 2051 shouldn't be difficult under the condition that both share the same hardware ..
Try to use disassembler to convert the HEX file to ASM then analize the code and make required changes i.e. assign pins used in the 52 version to those available in the 2051 hardware ..
2051 is a 20 pin microcontroller and 8052 is a 40 pin controller. there is no much difference in programming te basic differencewic ave to check is hardware . if ur hardwareis correct ten the same pogram used fo at89c2051is work for 8052 . u can check it and plz try.
2. Use the right include file for the 89S52 and re-assemble with no errors.
3. The 2051 will not be using any pins that are not present on the 89S52.
why not post the hex file, someone may help you out. The 2051 is small therefore there can't be that much code to disassemble. If you post the code make sure you give a detailed explanation of what it does, it may save someone a great deal of time.
I checked your code and no modification is needed to work with the 89S52. Make sure it is wired correctly to the appropriate pins like on the schematic.