Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/28/03 17:12
Read: times


 
#55643 - 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?


List of 9 messages in thread
TopicAuthorDate
I'm stuck with unexpected code behavior            01/01/70 00:00      
   RE: I'm stuck with unexpected code behavior            01/01/70 00:00      
   RE: I'm stuck with unexpected code behavior            01/01/70 00:00      
      RE: I'm stuck with unexpected code behavior            01/01/70 00:00      
   RE: I\'m stuck with unexpected code behavior            01/01/70 00:00      
      RE: I'm stuck with unexpected code behavior            01/01/70 00:00      
         RE: I'm stuck with unexpected code behavior            01/01/70 00:00      
            RE: I'm stuck with unexpected code behavior            01/01/70 00:00      
               RE: I'm stuck with unexpected code behavior            01/01/70 00:00      

Back to Subject List