We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi, all. I seem to have a problem with C51 (DOS) v5.50 and the Atmel AT89S53. The program is all C (no assembler) and accesses different parts of XDATA memory from both the normal main program and also from an interrupt function. It appears that main's xdata addresses are corrupted. The problem goes away if the pragma is removed. The v5.5 release notes say that the MODA2 pragma is only for the AT89S8252, but as I understand it all the Atmel AT89 cores implement the dual pointers in the same way. The problem also goes away if I don't use strcpy, which may point to a library issue. Has anyone else seen this problem? Would a subtle error in the header file for the processor have any bearing on the problem? Your thoughts would be appreciated. Richard
When you say, "second data pointer," does that actually mean, "the currently non-selected data pointer?" Yep, that's right. Note that if an interrupt uses DPTR (whichever one is currently selected) it saves it. The only problem is when you call a routine inside an ISR that was compiled with MODA2 that subsequently calls strcpy or strcmp. In that case, the ISR is compiled without dual data pointer support, however, it calls another function that was compiled WITH dual data pointer support. Jon
When you push dpl and dph at the begin of interrupt routine, altough dps is set to use dptr1, problems will occur. For ex. INC DPTR will do it. Roman