Hi Everyone Have any C51 of instructs application like assembler code? PUSH DPL PUSH DPH . . . . POP DPH POP DPL
The thing is, if you write your code entirely in 'C' you will never know, or need to know what the contents of DPTR or any other 'general purpose' registers actually are. The compiler will save and restore any registers it needs to. The only registers you need to concern yourself with are SFRs which control peripherals such as the timers. A large part of the reason for using 'C' rather than assembler is to achieve this pleasant level of abstraction. I the code you posted you are saving DPTR, writing to somewhere in the xdata memory space then restoring DPTR. In 'C' all this would be handled by the compiler. To write to a specific xdata address you could use something like: XBYTE[0x8000]=0xff; See the macros in absacc.h.