NEC V20
The NEC V20 was a microprocessor made by NEC. It was both pin and object-code compatible with the Intel 8088, with an instruction set architecture similar to that of the Intel 80188 with some extensions. The V20 was introduced in March 1984.

Features 
The V20's die comprised 63,000 transistors, more than double the 29,000 of the 8088 CPU. The chip was designed for a clock duty cycle of 50%, compared to the 33% duty cycle used by the 8088. Internal differences meant that a V20 could typically complete more instructions in a given time than an Intel 8088 running at the same frequency.

The V20 was fabricated in 2-micron CMOS technology. Early versions were available that ran at speeds of 5, 8, and 10 MHz. In 1990, an upgrade to the fabrication process technology resulted in the V20H and V20HL, with improved performance and reduced power consumption. Later versions added speeds of 12 and 16 MHz. The V20HLs were also completely static, allowing their clock to be stopped.

The V20 was described as 16 bits wide internally. It used an 8-bit external data bus that was multiplexed onto the same pins as the low byte of the address bus. Its 20-bit wide address bus was able to address 1 MB.

The V20 was reported to have been compatible with the Intel 8087 floating-point unit (FPU) coprocessor. NEC also designed their own FPU, the μPD72091, which was cancelled before reaching production. They followed this with a revised design, the μPD72191, but it is unclear how many, if any, of this second part were produced.

The V30, a nearly identical CPU with a 16-bit wide external data bus, debuted on March 1, 1984. It was pin and object-code compatible with the Intel 8086.

ISA extensions

The V20 Instruction Set Architecture (ISA) included several instructions not executed by the 8088. These included instructions for bit manipulation, packed BCD operations, multiplication, and division. They also included new real-mode instructions from the Intel 80286.

The ADD4S, SUB4S, and CMP4S instructions were able to add, subtract, and compare huge packed binary-coded decimal numbers stored in memory. Instructions ROL4 and ROR4 rotate four-bit nibbles. Another family consisted of the TEST1, SET1, CLR1, and NOT1 instructions, which test, set, clear, and invert single bits of their operands, but are far less efficient than the later i80386 equivalents BT, BTS, BTR, and BTC; neither are their encodings compatible. There were two instructions to extract and insert bit fields of arbitrary lengths (EXT, INS). And finally, there were two additional repeat prefixes, REPC and REPNC, which amended the original REPE and REPNE instructions for scanning a string of bytes or words (with instructions SCAS and CMPS) while a less or not less condition remained true.

The V20 offered a mode that emulated an Intel 8080 CPU. A BRKEM instruction is issued to start 8080 emulation. The operand of the instruction specifies an interrupt number whose vector contains the segment:offset where emulation is to begin. To end, a RETEM instruction is issued in 8080 code.  One feature not often employed is the CALLN (call native) which issues an 8086-type interrupt call that enables x86 code (which returns using an IRET) to be mixed in with 8080 code.

Another mode put the processor into a power-saving state via a HALT instruction.

Lawsuit 
In 1982 Intel sued NEC over the latter's μPD8086 and μPD8088. This suit was settled out of court, with NEC agreeing to license the designs from Intel.

In late 1984 Intel again filed suit against NEC, claiming that the microcode in the V20 and V30 infringed its patents for the 8088 and 8086 processors. NEC software engineer Hiroaki Kaneko had studied both the hardware design of the Intel CPUs and the original Intel microcode.

In its ruling, the court determined that the microcode in the control store constitutes a computer program, and so is protected by copyright. They further found Intel had forfeited their copyright by neglecting to ensure that all second-source chips were suitably marked. The court also determined that NEC did not simply copy Intel's microcode, and that the microcode in the V20 and V30 was sufficiently different from Intel's to not infringe Intel's patents.

This ruling established the legality of reverse engineering.

Variants and successors

See also 
 NEC RX116, dedicated ITRON-1-based 16-bit RTOS
 NEC μPD9002, a Z80 and x86 compatible CPU
 VIA Alternate Instruction Set, a CPU implementing a similar scheme to enter and exit into an alternate instruction set mode

References

Further reading 
 V20/V30 User's Manual; NEC; 228 pages; 1986. (archive)

External links 
 
 
 

V20
16-bit microprocessors