When using ERASECODE don't forget this (a part from an e-mail from Melab support)
The erase blocks of 64 bytes do, in fact, have specific start/end
addresses that are arranged starting at address 0. The datasheet
refers to these blocks as "rows".

Each block (0-63, 64-127, etc.) will be erased in its entirety when
you use ERASECODE at any address within the block.

If you want to preserve part of the data in a block, use READCODE to
save the information before you erase, then WRITECODE to restore the
block with modified data afterward.

The best way is to learn from other's misstakes :-)

/me