Patent ID: 7979606

Claim:
A method for storing data, suitable for storing data into a program memory used for storing program codes, the program memory comprising a first buffer storage area and a second buffer storage area, wherein the first buffer storage area comprises a first data area and a first mark area, and the second buffer storage area comprises a second data area and a second mark area, both the first buffer storage area and the second buffer storage area contain data and the method comprising: removing the data in the first buffer storage area after the data stored in the first data area is copied to the second data area; receiving a first data storage instruction; storing first data into the first data area, and writing a first mark data into the first mark area for marking blocks written with the first data in the first data area; copying data stored in the second data area to the first data area, and remaining the blocks in the first data area that are marked by the first mark data as being written with the first data uncovered after the first data is stored into the first data area; and removing the data in the second buffer storage area after the data stored in the second data area is copied to the first data area, wherein the first data and the data stored in the first buffer storage area are not removed simultaneously.