Texas Instruments TMS9900


Introduced in June 1976, the TMS9900 was one of the first commercially available, single-chip 16-bit microprocessors. The TMS9900 found its most widespread use in the Texas Instruments TI-99/4 and TI-99/4A home computers.

History

The TMS9900 was designed as a single chip version of the TI 990 minicomputer series, much like the Intersil 6100 was a single chip PDP-8, and the Fairchild 9440 and Data General mN601 were both one-chip versions of Data General's Nova. Unlike other 16-bit microprocessors such as the National Semiconductor IMP-16 or DEC LSI-11, some of which predated the TMS9900, the latter was a single-chip, self-contained 16-bit microprocessor.
TI used the same architecture across different divisions for corporate synergy: "one company, one computer architecture". In the late 1970s Walden C. Rhines gave a presentation of the TMS9900 to an IBM group developing a personal computer. "We wouldn’t know until 1981 just what we had lost" because IBM chose the Intel 8088 for the IBM PC, he recalled. After the failed attempt to get into the personal computer market with products such as TI-99/4A, the company microprocessor division eventually switched focus to the TMS320 special-purpose processor series.

Architecture

The TMS9900 has three internal 16-bit registers — Program counter, Status register, and Workspace Pointer register. The WP register points to a base address in external RAM where the processor's 16 general purpose user registers are kept. This architecture allows for quick context switching; e.g. when a subroutine is entered, only the single workspace register needs to be changed instead of requiring registers to be saved individually.
Addresses refer to bytes with big endian ordering convention. The TMS9900 is a classic 16 bit machine with an address space of 216 bytes.
There is no concept of a stack and no stack pointer register. Instead, branch instructions exist that save the program counter to a register and change the register context. The 16 hardware and 16 software interrupt vectors each consist of a pair of PC and WP values, so the register context switch is automatically performed by an interrupt as well.

Instruction set and addressing

The TMS9900 has 69 instructions which are one, two or three words long and always word-aligned in memory. The instruction set is fairly orthogonal, meaning that with few exceptions, instructions can use all methods of accessing operands.
Addressing modes include Immediate, Direct or "Symbolic", Register, Register Indirect with or without auto-increment, Indexed, and Program Counter Relative.
The most important dual-operand instructions contain 2-bit addressing mode and 4-bit register selector fields for both source and destination operands. In the opcode, "Symbolic" mode is represented as Indexed mode with the register field set to 0, therefore workspace register 0 cannot be used in Indexed mode. In less frequently used dual-operand instructions like XOR, the destination operand must be a workspace register.
Flow control is facilitated through a group of one unconditional and twelve conditional Jump instructions. Jump targets are relative to PC with an offset of -128 to +127 word addresses.
For subroutine calls, the Branch and Load Workspace Pointer instruction loads new WP and PC values, then saves the values of WP, PC and ST to the registers 13, 14 and 15 respectively. At the end of the subroutine, the Return Workspace Pointer restores these in reverse order. Using BLWP/RTWP, it is possible to nest subroutine calls despite the absence of a stack, however, the programmer needs to assign the appropriate register workspace explicitly.
The instruction set also contains a Branch and Link opcode that only saves PC to register 11 without changing WP. In this case, a branch instruction using WR11 as the destination address can serve as the return opcode, but BL-type subroutines cannot be nested without the programmer taking actions to save the return address.
The TMS9900 has an uncommon, and rarely used, instruction called "X". This instruction is used to execute another instruction at an address pointed to by a register without changing program flow, i.e. execution continues at the address following the X instruction. This instruction can be used for debugging and for creating indexed-opcode tables as used in byte-code interpreters.
The TMS9900 also supports the eXtended OPeration instruction. XOP is given a number in the range 0-15 as well as a source address. When invoked, the instruction will perform a context switch through one of sixteen vectors at predefined locations in memory. This is similar to an interrupt, but the XOP instruction also stores the source address in register 11 of the new workspace. XOP is less flexible than a BLWP, as the transfer vectors have to be at fixed locations, but saves memory, since the source address can be used by the executed subroutine instead, when it's not defining the location of the vector.
XOP is used to implement instructions in software in lower end models, where higher end versions of the 990 minicomputer series may have dedicated hardware to execute them.
In typical comparisons with the Intel 8086, the TMS9900 had smaller programs. The only disadvantages were the small address space and need for fast RAM.

Implementation

The TMS9900 was implemented in an N-channel silicon gate MOS process, which required +5 V, −5 V and +12 V power supplies and a four-phase clock with a maximum frequency of 3 MHz, usually generated from a 48 MHz crystal using a TIM9904 clock generator chip.
The shortest instructions require eight clock cycles or 2.7 μs to complete, many others run between 10 and 14 cycles ; the longest-running instruction can take up to 124 cycles.
The chip was packaged in a 64-pin, 0.9" wide DIP. The comparatively large number of pins allowed for the 15-bit address bus and 16-bit data bus to be brought out on dedicated pins without the use of multiplexing, keeping external memory connections simple. Contrary to the convention used by many other manufacturers, TI labeled the most significant address and data lines "A0" and "D0", respectively. All internal data paths and the ALU are 16 bits wide.
The processor can be paused with the address bus tri-stated for external direct memory access.
Memory accesses are always 16 bits wide, with the CPU automatically performing read-before-write operations for byte-wide accesses.
The hardware interrupt system supports a 4-bit interrupt priority input, which needed to be higher than the priority level stored in the status register in order for the interrupt request to be served. In addition, the /LOAD input provides a non-maskable interrupt facility with a dedicated vector.
The TMS9900 CPU also contains a 16-bit shift register designed for interfacing with external shift registers, with dedicated instructions supporting access to fields of 1−16 bit width out of a total of 4096 addressable bits.
Parallel peripherals can be attached in memory-mapped fashion to the regular address and data bus.

Applications

The TMS9900 was used in the TI-99/4 and TI-99/4A home computers. Unfortunately, to reduce the production costs, TI chose to use in these systems just 128 16-bit words of the fast kind of RAM that the TMS9900 could access directly. The rest of the memory was 16kB of 8-bit DRAM that was accessible only indirectly through the video display controller, which crippled the performance of the TI-99/4.
TI developed the TM990 series of computer modules, including CPU, memory, I/O, which when plugged into a card frame could form a 16-bit minicomputer. These were typically used for process control. A microprocessor trainer was released in the form of the TM990/189.

TMS9900 Family Product Development

The second generation of the TMS9900 family of microprocessors was the TMS9995 which provided "functional performance at speeds 3 times faster than any previous 9900 family processor", largely due to the inclusion of instruction prefetch technology. In the home computer arena, the TMS9995 only found use in the Tomy Tutor, an esoteric TI99-4/A upgrade called the Geneve 9640, and a project printed in Electronics Today: the Powertran Cortex. It was planned to be used in the TI-99/2 & TI-99/8 computer systems, but neither advanced past the prototype stage.
TI later developed the more powerful TMS99000 family of microprocessors, which was used as the CPU in the 990/10A minicomputer as a cost reduction. Unfortunately, by the time the 990/10A made it to market, the end of the minicomputer era was already in sight.
The TMS99000 family includes two microprocessors, the TMS99105A and the TMS99110A, which are identical except for inclusion of on-chip macrostore ROM memory. The on-chip ROM Macrostore in the TMS99110A microprocessor contains floating point instructions which are available as part of the machine language instruction set, while the TMS99105A does not include a ROM macrostore. A third member of the TMS99000 family, the TMS99120, was announced but may never have been commercially produced. The on-chip ROM Macrostore in the TMS99120 contains run-time support routines for the PASCAL high-level language.
The instruction set for the TMS99000 family is a superset of the TMS9995 and TMS9900, with object code compatibility. The additional instructions includes those for signed multiply and divide; long-word shift, add, and subtract; load status register, load workplace pointer, stack operations, multiprocessor support, bit manipulation. Members of the family can instantaneously access 256KiB of memory, and may use the TIM99610 memory mapper to address up to 16MiB. The architecture contains many other advances over the TMS9900 and TMS9995.

Variants