Hi,
I am trying to use large memory model" with AT89C51RD2. I have written a simple UART code and trying to debug the code with the simulator. Once, the code enter into the ISR the following error message comes up "Clock is not working"
And when using small memory model the error didn't pop up. Could anyone pleas let me know what is the reason behind this error message when using the large memory model.
Using large memory model with AT89C51RD2 works well. If you consider a considerable waste of code space and CPU cycles "working well", maybe.
Oh, and the actual cause of your problem is precisely that #pragma moddp2. That's the wrong switch for the CPU you're working with. For this one it should be "modp2" (only one 'd'). And generally you shouldn't put that option into the source anyway, but rather set the global switch in the project settings' "Target" page: "Use multiple DPTR registers", instead.
The reason this failed so interestingly is that enabling the wrong switch along with large model caused the compiler to generate extended interrupt entry code for that other CPU, which needs preconditions that your code, being for a different processor, doesn't establish.
Thank you very for pointing the mistake and detailed explanation.
This solution fixed the issue