what's the affect of XDATA space memory overlap?

what's the affect of XDATA space memory overlap?
I have 128 Kbytes of external ram so I use 17 Address buses and switch between 2 pages of ram by A17.
I use _at_ for some data that I want to fix at both pages so there are some space overlap(variables have same address but not the same page when run) and keil warn me about this.
The problem is my code doesn't work although my last version that doesn't use _at_ works well.
Can I ignore this warning? How should I do?
I don't know the problems are from my code or from this warning. I'm checking but can't find something wrong.
Thank you very much.

Parents
  • hi,
    I have 128 Kbytes of external ram so I use 17 Address buses and switch between 2 pages of ram by A17.

    1)You are right, to access 128kb you need with 17 address lines: A0...A16. So I think you meant A16, not A17, as bank switch.

    2)Follow Drew Davis suggestion and then create own XBANKING.A51 based on original one; this is correct (and convenient!) way to fix your troubles only.

    2)Andrew Neil: it is not always easy to use union for such purposes. For example, next definitions may be translated to union easy:

    unsigned char xdata var_a1 _at_ 0x0010; // bank 1
    unsigned char xdata var_b1 _at_ 0x0010; // bank 2
    
    but next:
    unsigned char xdata var_a1[100]	_at_ 0x0000; // bank 1
    unsigned int xdata var_b1	_at_ 0x0064;
    
    unsigned char xdata var_a2	_at_ 0x000F; // bank 2
    unsigned long xdata var_b2[32]	_at_ 0x0010;
    

    Regards,
    Oleg

Reply
  • hi,
    I have 128 Kbytes of external ram so I use 17 Address buses and switch between 2 pages of ram by A17.

    1)You are right, to access 128kb you need with 17 address lines: A0...A16. So I think you meant A16, not A17, as bank switch.

    2)Follow Drew Davis suggestion and then create own XBANKING.A51 based on original one; this is correct (and convenient!) way to fix your troubles only.

    2)Andrew Neil: it is not always easy to use union for such purposes. For example, next definitions may be translated to union easy:

    unsigned char xdata var_a1 _at_ 0x0010; // bank 1
    unsigned char xdata var_b1 _at_ 0x0010; // bank 2
    
    but next:
    unsigned char xdata var_a1[100]	_at_ 0x0000; // bank 1
    unsigned int xdata var_b1	_at_ 0x0064;
    
    unsigned char xdata var_a2	_at_ 0x000F; // bank 2
    unsigned long xdata var_b2[32]	_at_ 0x0010;
    

    Regards,
    Oleg

Children
More questions in this forum