You need to use the Long Indirect Indexed addressing mode. This allows you to set a memory address in RAM, then use the X or Y register as an index from that address. Once 256 bytes are covered, increment the address in RAM until you have covered the memory range required. I can provide demo code if required. regards, Simon Anglia
Have a look at Application Note 1070 ''ST7 Checksum Selfchecking capabelity''. This application note describes a software technique to determine if the data and program in flash have been corrupted.