normal or is rewriting information stored in flash memory 60 for convenience 39 sake in the following description a case in which the microcomputer is operating in accordance with user code data as normal is referred to as the first mode and a case in which the microcomputer is rewriting information stored in flash memory 60 is referred to as the second mode in more detail during the first mode bus switch 40 connects address bus a bus 1 and data bus d bus 1 from cpu 10 to address bus a bus 3 and data bus d bus 3 which lead to flash memory 60 on the other hand during the second mode bus switch 40 switches address bus a bus 3 and data bus d bus 3 which lead to flash memory 60 from address bus a bus 1 and data bus d bus 1 to address bus a bus 2 and data bus d bus 2 from flash control register 50 as can be understood from fig2 the bidirectional bus is the data bus and the unidirectional bus is the address bus flash control register 50 is provided for receiving requests from cpu 10 during the second mode and for carrying out for example writing of data to flash memory 60 in more detail flash control register 50 is provided with an address point register a write buffer register and a mode control register the address point register is provided for setting the addresses to be written to in flash memory 60 the write buffer register is provided for setting data to be written to flash memory 60 the mode control register is provided for setting a prescribed value indicating commands such as write or delete to flash memory 60.