Peter,

>       Can someone suggest how to avoid the allocation in DSEG (which is 
> overfull) in the following code snippet?
> 
> ...
> void lcd_puts (char xdata *str)
> {
>   uint8 xdata i;
> 
>   for (i=0; str[i] != '\0'; i++) {
>     lcd_datas (str[i]);
>   }
> }

To put the pointer in xdata you must add the memory type 
behind the * as explained in the manual. Furthermore you 
can get rid of i and expensive indexing if use the 
pointer itself.

void lcd_puts (char xdata * xdata str)
{
    while (*str != '\0') {
    lcd_datas (*str++);
  }
}

Maarten

------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to