Microcode is a set of instructions that are not program accessible. The instructions are typically written on read-only memory chips used by hardware for specific instructions. A video card or other add-on card used in a computer may contain such code to aid it in completing its tasks.
Many microprocessors use microcode to handle machine instructions and assist the chips or CPU in operations. The updates to this code can be contained in firmware, which replaces the existing code. Since it is not accessible while the hardware is running, there is typically a specific way that the new code needs to be loaded, depending on the device.
Some routers or hardware firewalls store their operating systems in EPROM, and have no hard disks in them to store programming. The configurations for these devices are stored in both read-only memory, so the device can lose power without losing its configuration, and in random access memory, in which the configuration is stored while the device is running. Updates to the operating system software of these devices are examples of microcode stored on EPROM chips that must be handled in a certain way for them to be correctly applied.
Microcode software can adapt to the conditions of the chips it exists on better than things written to the circuitry of the chips. This helps developers and others working with the hardware keep the chip up to date without constantly needing to release a new card with different circuitry. The use of such code can save both the consumer and the vendor money in the long term.
Chip makers can also retain backward compatibility from one chip to the next because the microcode can be designed to allow newer hardware to add new instructions when they are available. When a CPU detects other hardware installations, there may be code found that can help the CPU and the new card interact better within the system. The code may also permit emulations, which might be similar to something an application might use within an operating system. For example, in the same way that a previous copy of an application can be run in compatibility mode in Windows, hardware configurations can be emulated by code to allow previous versions of hardware to function alongside or in place of their newer counterparts.