Subscribe to the wiseGEEK Feed

What is Microcode?

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 microcode 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 microcode with updates. Since this code is not accessible while the hardware is running, there is typically a specific way that the new microcode 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 also 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 microcode can save both the consumer and the vendor money in the long term.

Microcode also helps chip makers retain backward compatibility from one chip to the next because it 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. This is a benefit of microcode. Others include emulation capabilities 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 microcode to allow previous versions of hardware to function alongside or in place of their newer counterparts.

Written by Derek Schauland