font[i].count & font[i-16].count in 390

The target options:contiguous mode:512KB program,off-chip code memory(0x0000:0xfc00),off-chip xdata memory(0x20000:0x10000).

extern code struct font_t font[];
void main(void)
{
    unsigned char count;
    unsigned int i = 67;

    count = font[i].count;
    count = font[i-16].count;
}
In the above test program,I cann't get my second count accessing because the compiler generate the following code
......
mov R7,#43;    i value
mov B,#0x42;   sizeof(struct font_t) = 0x42
mov A,R7
mov DPTR,#0x10787;  ???
ACALL    C?OFFXADD(C:000702);get DPTR
clr A
movc A,@A+DPTR; count
......
the error lies in mov DPTR,#0x10787 that should be mov DPTR,#0x0787 because the font is located c:0x0BA7.
Resolution?

Parents Reply Children
No data
More questions in this forum