1. Field of the Invention
This invention relates to a mobile electronic device such as an IC card containing an IC chip which includes a data programmable or rewritable nonvolatile memory, a control element such as a CPU and an interface which inputs/outputs data, for example.
2. Description of the Related Art
Conventionally, some of IC cards used as mobile electronic cards are operated on power supply voltages supplied from a host device (card reader/writer). With this type of IC card, if the power supply voltage supplied from the host device is unstable, a process of writing data into the nonvolatile memory fails in some cases. Even if such a data writing failure occurs, the following data write ensuring method is conventionally proposed to ensure data in the nonvolatile memory.
As the conventional data write ensuring method, there is provided a method for writing old data written in a target area into which new data is to be written into another area, then writing the new data into the target area and finally writing a status indicating that the new data writing process has been completed into a management information area. With this method, it is necessary to perform the process of writing data into the nonvolatile memory three times. Therefore, with this method, it becomes difficult to enhance the operation speed of whole process of writing new data.
Further, in the conventional data write ensuring method, the process of writing data into the nonvolatile memory is ensured for each preset physical storage area (page). Therefore, if one data item having significance lies over a plurality of pages or divided and stored over a plurality of files, it is difficult to ensure whole data.