This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I'm stuck with unexpected code behavior

I'm using quite old version of Keil, 3.20. With following simple code, I get unexpected results. I believe there is some kind of code problem:

xdata char msg1[]="abc";
xdata char msg2[]="def";
void main()
{
   init_8255();
   init_lcd();
   lcd_open_backlight();
   lcd_cursor_on();

   // here, i suppose to write "abc" to the first row
   lcd_print(10, 0, msg1);
   // here, i suppose to write "def" to the second row
   lcd_print(10, 1, msg2);

   strcpy(msg1, "ghi");
   strcpy(msg2, "ijk");

   // here, i suppose to write "ghi" to the 3rd row
   lcd_print(10, 2, msg1);
   // here, i suppose to write "ijk" to the 4th row
   lcd_print(10, 3, msg2);

   while (1);
}

With this code I expect to see following:
   "abc"
   "def"
   "ghi"
   "ijk"

However I get:
   [empty]
   "ijk"
   [empty]
   "ijk"

I've configured the compiler as following:
  #pragma CODE DEBUG SYMBOLS LARGE ROM(LARGE) NOLISTINCLUDE

I have xdata starting at 8000H with length 8000H. both xdata and data are cleared during initialization.

And, yes I tried to use DS51. With debugger everthing seems OK.

Can anyone have any clue about this strange behavior?

0