Here's another good one. Again, works fine on simulator/debugger, but not on the target hardware. If I do this: BYTE process_Help(char *cmdBuffer) reentrant { cmdBuffer[0] = '\0'; printf( "Help Message"); return TRUE; } everything works fine. But if I do this: BYTE process_Help(char *cmdBuffer) reentrant { char *strHelp = "Help Message"; cmdBuffer[0] = '\0'; printf(strHelp); return TRUE; } it works fine on the simulator/debugger, but nothing is displayed when executed on the target hardware. Any/All help welcome and appreciated. Thanks, Chris Beattie
Your problem may be in the way you are declaring your pointer. Since you are not specifying which memory the pointer strHelp resides in, I am assuming your memory model is small and strHelp is in internal data by default. I have found that to make pointers in internal memory using the C51 compiler, you have to declare them *exactly* the way the example shows on page 76 (the section on memory-specific pointers) of the C51 manual (User's Guide 01.97). The example shows: int xdata * data numtab; /*ptr in data to xdata int */ I had declarations in my code that were the equivalent of the following: xdata int data *numtab; The manual said that the compiler would accept this form to maintain compatibility with old code - and indeed it did compile. However, the code would not work when it was being tested. Once my pointer declarations matched the first example above, they started to work. You might
xdata int data *numtab; is equivelent to int data * xdata numtab; So you were declaring the variable wrong until you went to the new style.