Is there a way to convert the c51 compiler so I can write programs on my mobile phone (a galaxy s2) and then download them onto the atmel at89s51 mcu?
"No need for that, they already exist."
Yes and no.
I know about emulators capable of running MS-DOS. But does there exist any emulators supporting 386+ processors with protected mode?
"But does there exist any emulators supporting 386+ processors with protected mode?"
Something like Bochs might have been ported - But I would think that even on a fast tablet or iPhone it's going to run Windows pretty damn slow!
"But I would think that even on a fast tablet or iPhone it's going to run Windows pretty damn slow!"
Of course. If the job really has to be done with a phone/tablet, it would be way better to network to a PC (X-Windows or Remote Desktop) and have the PC do the actual work.