# Research Machines 380Z

The Research Machines 380Z (often called the RML 380Z or RM 380Z) was an early 8-bit microcomputer produced by Research Machines in Oxford, England, from 1977 to 1985.

## Description

The 380Z used a Z80 microprocessor (hence the name) with up to 56 KB of user RAM. When fitted with an optional floppy disk drive the system ran the CP/M operating system. The basic system came with a text-only monochrome video card, which could be enhanced with a 320×192 high-resolution graphics board.
Aided by a British government subsidy to schools for half of the price the 380Z was sold mainly to educational institutions in the United Kingdom, with some also sold to industry. In 1979 a dual 8-inch disk system with 56 KB of memory cost £3266, and a 16 KB cassette-based system cost £965 (excluding VAT).

## Hardware
### Architecture

The 380Z was packaged in a large, black, 19-inch rack-mount, rectangular metal case containing the power supply, a number of printed circuit boards and the optional 5¼-inch floppy disk drives. The front panel had a pair of strong carrying handles, a keyswitch and a reset button. The keyswitch controlled power and also enabled the reset button. The keyboard was separate and came in a tough metal case.
Early versions were contained in a light blue metal case with a white front and had only a cassette interface or 8-inch floppy drives; only a small number of these were made. An optional 8-bit ASCII paper tape punch/reader was also used, as this was a common storage medium at the time - where previous use of a computer had been limited to a teletype machine connected to mainframe by telephone.
The system used a passive bus architecture with no motherboard – all electronics were contained on a number of cards interconnected by ribbon cable. The only microprocessor offered was a 4 MHz Z80A.

### Memory

Memory was fitted in up to four banks of RAM, each of either 4 KB (4 × 1024 bytes) or 16 KB, although not every permutation was permitted. Typical configurations were 16 KB for cassette-based systems and 32, 48 or 64 KB of memory on disk-based systems. Main memory was not used by the text or graphics video cards, although memory on the video cards was bank switched into a dedicated 1.5 KB address block.
The 380Z was also fitted with up to 6 KB of firmware, known as COS. On systems fitted with less than 64 KB of RAM the COS reserved 1 KB of system RAM, leaving the rest available to the user. On the 64 KB RAM system a total of 56 KB was available to the user, with the remainder used by COS or inaccessible because of the firmware ROM, video card, and memory-mapped I/O.

### Video

COS 3.4 (see below) and earlier systems came with a basic video card providing a 40×24 text-only monochrome display. Composite video output was provided for an external monitor, and an internal RF modulator provided a separate output to drive a television set. Later systems were supplied with an enhanced video card that was software-switchable between 40×24 and 80×24 character modes and supported a number of character attributes (underline, dim, reverse-video). Both card types were fitted with their own dedicated video memory.
In addition to the text-mode video card the system could be enhanced with a high-resolution graphics (HRG) board. The board was fitted with a dedicated bank of 16 KB of video memory and supported two graphics modes:
* High resolution: 320×192 pixels, 2 bits per pixel (4 colours), 1 page.
* Medium resolution: 160×96 pixels, 4 bits per pixel (16 colours), 2 pages.
A programmable lookup table with an 8-bit output mapped the pixel value to one of 256 different colours (analogue RGB output) or intensities (composite video). In RGB mode, each palette index can configured by specifying the amount of each primary colour. Possible ranges are 0 to 7 for Red and Green, and 0 to 3 for Blue (ex: 000 generates black; 773 generates white). This arrangement is known as 8-bit color and also used on other machines like the MSX2 or Atari Falcon.
Output from the graphics board was mixed with output from the text-only video card, allowing text and graphics to be easily overlaid. The graphics output only covered the top 20 lines of the text display and therefore text output could be set to use only the bottom 4 lines if overlap was not desired.

### Storage

Mass storage was either via cassette tape or floppy disk (which required a disk controller card). The cassette interface operated at either 300 bit/s (CUTS standard) or 1200 bit/s. COS 4.0 and later systems were not fitted with the cassette interface.
Early systems could be fitted with an optional single density floppy disk controller card that could interfaced to either internal 5¼-inch or external 8-inch floppy disk drives. Disk capacity was 80 KB per side on 5¼-inch disks and 250.25 KB per side on 8-inch disks. Double-sided disk drives were treated as two independent disks with a drive letter per side. CP/M used the first 4 tracks on 5¼-inch disks and the first 3 tracks on 8-inch disks, reducing the usable capacity of a single density, single-sided 5¼-inch disk to 72 KB.
Later systems (referred to as the 380Z-D) were fitted with a double density Intelligent Disc Controller (IDC), which increased disk capacity to either 180 KB (48 TPI drives) or 360 KB (96 TPI drives) per side on 5¼-inch disks and 500.5 KB per side on 8-inch disks. Support for a "Winchester" hard disk drive could be provided using an intelligent Host Interface Board (HIB) that implemented a SASI interface. Hard disk systems were mainly used as file servers for networked LINK 480Z systems.

### Interface cards

The passive bus allowed a number of cards to be installed in the 380Z. All systems required:
* CPU/RAM – holding the Z80A CPU, firmware ROMs, and up to 32 KB of RAM. The card also provided a parallel Centronics printer port (not always connected).
* Video, either a VDU-40 or VDU-80 card – providing the 40×24 or the switchable 80×24/40×24 character text displays, respectively.
Other cards were optional, and included:
* RAM – a second CPU/RAM board, with processor and ROMs omitted, holding up to a further 32 KB of RAM.
* Floppy Disc Controller (FDC) – a single density disk controller, which also provided an RS-232 serial interface (SIO-4).
* Intelligent Disc Controller (IDC) – a double density disk controller with its own dedicated microprocessor.
* High Resolution Graphics (HRG) – up to 320×192 pixels.
* Host Interface Board (HIB) – for hard disk support.
* 380Z Network Interface Board (380Z-NET) – a proprietary 800 kbit/s network interface used to interconnect to a network of LINK 480Zs.
* Serial Interface-1 (SIO-1) – available as the SIO-1A (RS-232) or SIO-1B (20 mA current loop).
* Serial Interface-2 (SIO-2) – available as the SIO-2 (RS-232) or SIO-2B/SIO-3 (20 mA current loop).
* Serial Interface-4C (SIO-4C) – providing an SIO-4 interface on cassette systems without the FDC card.
* IEEE-488 Interface.
* PIO Interface Development Board – providing three Z80 PIOs and a Z80 CTC.
* Analogue I/O Board – providing 16 input channels and 2 output channels.

## Firmware
### Boot monitor

The system firmware contained only a basic monitor program, known as COS (standing for Cassette Operating System in the COS 3.4 and earlier systems and Central Operating System in the later disk-only systems). The monitor could be used to load application programs, such as BASIC, from cassette or to boot the disk operating system. COS also provided a software front panel allowing the display of registers and memory, and supporting breakpoints and single-stepping of machine code.
The COS monitor was stored in either 4 KB (COS 3.4 and earlier) or 6 KB (COS 4.0 and later) of ROM; in the latter case part of the ROM was bank switched.

### COS services

COS provided a number of basic hardware control functions, such as keyboard input, writing text to the video card and disk input/output. COS functions were called by means of the Emulator Trap (EMT) pseudo-opcode, which used the Z80 RST 30H instruction to call the EMT handler function. The EMT handler read the first byte following the RST 30H instruction to determine which EMT function was being requested; all parameters were passed in registers. A call-relative pseudo-opcode was also implemented using RST 28H.

### Main COS versions

COS versions were mainly tied to the new hardware functions they supported.
* COS 2.2 –
* COS 2.3 – cassette-only, 40×24 video card.
* COS 3.0 – floppy disk support.
* COS 3.4C – cassette-only, 40×24 video card.
* COS 3.4M – main COS version supporting single density disks and the 40×24 video card.
* COS 4.0 – 80×24 text display, no cassette support.
* COS 4.2 – double density disk drives (380Z-D).

## Software
### Operating systems

The main disk operating system was CP/M, initially CP/M 1.4 and later CP/M 2.2. MP/M II was used on the file server version, which supported a network of LINK 480Z computers using CP/NET.

### Application software

Many standard CP/M applications were available, such as WordStar. Research Machines also produced their own assembler (ZASM), text editor (TXED) and BASIC interpreter. Brian Reffin Smith, then at the Royal College of Art in London, wrote 'Jackson', one of the first digital painting programs, which ran on the 380Z and which was distributed across UK schools.