The main program in i4004em, em.c, emulates an Intel 4004 microprocessor, its ports, its registers, and its memory management. The emulator reads the output of a 4004 compiler and displays the registers as it interprets the machine instructions.
The emulator allows a student to become familiar with the Intel 4004 microprocessor without having to spend hundreds of dollars on building a test machine. Building a test machine is expensive and time consuming and is less flexible than using an emulator. An emulator adapts itself to a wide variety of hardware configurations, whereas it is harder to reconfigure a physical machine.
See Features for a more detailed explanation of the emulator's features.