It some time ago when I tried banked data on Z180. Below is my test code. BBR is banking register.

Hynek Sladky


// bank access
void setb_0(void) {BBR = 0;}
void setb_1(void) {BBR = 1;}
void setb_2(void) {BBR = 2;}

__addressmod setb_0 b_0;
__addressmod setb_1 b_1;
__addressmod setb_2 b_2;

// banked variables
b_0 int a_0 = 0;
b_1 int a_1 = 0;
b_2 int a_2 = 0;

void main (void) {
  a_1 = 1;
  a_2 = 2;
  while (1) {
    a_0 = a_1 + a_2;
    a_1++;
    a_2++;
  }
}



_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to