Problem with Serial.print after adding FOR loop

The correct way the code shall work is that it will serial.print the contents of 2D array variable Y and after that compare the contents of 2D array Y with another predefined 2D array buffer.

As u can see in my code, there are 2 sets of nested FOR loop. With 2 sets of nested FOR loop, the code doesn't work. However, when I comment away the 2nd nested FOR loop, it works perfectly!

The 2 sets of nested FOR loops have no relation to each other as u can see. What is the problem? Can someone help me out?

void loop() {
  byte y[41][256]={
    0    };
  int a;
  int b;
  for (a=0;a<41;a++){
    for (b=0;b<256;b++){
      Serial.print("Address:|");
      Serial.print(address);
      Serial.print("| - Value:|");
      y[a][b]=disk1.read_byte(address);
      Serial.print(y[a][b], DEC);
      Serial.print("|\n");
      address++;
      delay(100);
    }

    if (address == 10495)
    {
      address = 0;
    }
  }

  for (a=0;a<41;a++){
    for(b=0;b<256;b++){
      if (y[a][b]==buffer[a][b]){
        Serial.print("OK");
      }
      else{
        Serial.print("NO");
      }
    }
  }
}

41 * 256 = ?

AWOL:
41 * 256 = ?

does it help if i were to store in the ROM memory of the microcontroller?

Bandofcs:

AWOL:
41 * 256 = ?

does it help if i were to store in the ROM memory of the microcontroller?

Yes, but remember, without rewriting the bootloader, that's going to be a compile-time only set of constants.