1. A system to extend the functionality of a ROM code, the system comprising: a ROM of a device coupled to receive data and an address range, the ROM comprises the ROM code that in response to receiving the address range makes a selection regarding a target location where to write the data, the selection regarding the target location being based on a determination by the ROM code as to whether the address range is addressed by the ROM code; and a secure memory coupled to the ROM, being internal to the device and being recognized by the ROM code, the ROM code being extended by selecting a routine that is accessed from the secure memory, the ROM code optionally selects: a first routine accessed from and performed by the ROM code to write the data to the secure memory if the address range is addressed by the ROM code, and a second routine accessed from and performed by the secure memory to write the data to an external memory if the address range is addressed by the secure memory.