The present invention provides a technique for preventing an erroneous write in and an erroneous erase from a nonvolatile memory, in the case of an erroneous operation of an arithmetic processor, at a low cost without providing any external circuit. A nonvolatile memory system comprises a nonvolatile memory, a volatile memory for storing a program containing an operation instruction to rewrite the contents of the nonvolatile memory, a processing device for controlling the nonvolatile memory and the volatile memory, first invalid instruction writing means for writing an invalid instruction in place of the operation instruction, at an initialization, at a predetermined address of the volatile memory for storing the operation instruction to the nonvolatile memory, control means for writing the operation instruction at the predetermined address of the volatile memory stored with the invalid instruction, before the start of the operation of the nonvolatile memory, and for operating the nonvolatile memory on the basis of the operation instruction, and second invalid instruction writing means for writing the invalid instruction at the predetermined address of the volatile memory after the execution of the operation of the nonvolatile memory.