a Assembly file dis_buffer: DS (%END_ACQ_CHAP+1)*1024+(3*1024) ;[1][1024]
a C file extern unsigned char xdata dis_buffer[8][1024]; . . . dis_buffer[15][(5 * 15) + k] = (dis_buffer[15][k] & mask[(k % 15) % 3]);
"dis_buffer: ... ;[1][1024]" First dimension: 1 "extern unsigned ... dis_buffer[8][1024];" First dimension: 8 "dis_buffer[15][(5 * 15) + k] =..." First dimension: indexed with '15'. What's going on?
dis_buffer[15][(5 * 15) + k] = (dis_buffer[15][k] & mask[(k % 15) % 3]);
""Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." --Brian Kernighan That's why I say, "You need to break this down into steps so that you can actually see & check what's going on!" You may also need to turn the optimisation down - otherwise the compiler might just optimise it back to where you started!