Vintage PC pages
Home -> Vintage PCs -> MDA notes

Monochrome Display Adapter: Notes

This document describes the behaviour of IBM's original Monochrome Display Adapter and some compatible cards.

The MDA is a monochrome card and displays on a TTL monochrome monitor. The original IBM mono monitor has green phosphor, so that's the colour I'll use when describing its behaviour. MDA monitors also exist with amber and white phosphor.

An alternative acronym for this card is MDPA (Monochrome Display and Printer Adapter).

Hardware requirements

The original MDA is a full-length 8-bit ISA card containing the display controller and a printer port. When present in a computer, it requires the following system resources:

The hardware

The MDA is based on an MC6845 cathode ray tube controller (CRTC) plus a lot of discrete logic. The two big chips on an MDA are the 6845 (soldered on) and the character generator ROM (usually socketed). Since the character set is in ROM, the only way you'll get a different one is with a new ROM.

The character ROM contains not only a 14-row font for normal operation, but two 8x8 fonts (one with thin uprights, the other with thick ones). This is because the same ROM is used on CGA cards; the 8x8 fonts are not displayed by the MDA.

Note that the character ROM is a 9264, which has a different pinout from the normal 27xx chip range (2764, 27128 etc.). This USENET posting describes how to get a 2764 ROM to work in a 9264 socket (it refers to the 5150 PC motherboard, but the pinout is the same for the MDA and CGA cards). Because the pinout is the same, it's possible to read the character ROM from an MDA or CGA by plugging it into the spare ROM socket on a 5150 motherboard.

Output is from a DE9 socket. The pinout of this socket is:

  1. Ground
  2. Ground
  3. Not connected
  4. Not connected
  5. Not connected
  6. High intensity
  7. Video
  8. Horizontal sync
  9. -Vertical sync

There is a single jumper (J1). In normal use, this is left open. It is probably used for diagnostic testing; if it is closed:

This appears to be used to isolate some of the card's subsystems from each other, for testing.

Memory Map

In normal use, an MDA produces an 80x25 text screen. Each character is 9 pixels wide and 14 high, giving a 720x350 pixel resolution. Although the characters are 9 pixels wide, the bitmaps in the ROM are only 8 pixels. For characters C0h-DFh, the ninth pixel column is a duplicate of the eighth; for others, it's blank.

The memory storage scheme is that two bytes of video RAM are used for each character (80*25*2 = 4000, neatly fitting in the 4k RAM on the card). The first byte is the character code, and the second gives the attribute.

Character codes match whatever the font ROM in use is. Normally this is 'codepage 437' - ASCII plus a collection of accented characters, line graphics and a few other characters.

The attribute bytes mostly behave like a bitmap:

but there are eight exceptions:

0001020304050607 08090A0B0C0D0E0F 1011121314151617 18191A1B1C1D1E1F
2021222324252627 28292A2B2C2D2E2F 3031323334353637 38393A3B3C3D3E3F
4041424344454647 48494A4B4C4D4E4F 5051525354555657 58595A5B5C5D5E5F
6061626364656667 68696A6B6C6D6E6F 7071727374757677 78797A7B7C7D7E7F
8081828384858687 88898A8B8C8D8E8F 9091929394959697 98999A9B9C9D9E9F
A0A1A2A3A4A5A6A7 A8A9AAABACADAEAF B0B1B2B3B4B5B6B7 B8B9BABBBCBDBEBF
C0C1C2C3C4C5C6C7 C8C9CACBCCCDCECF D0D1D2D3D4D5D6D7 D8D9DADBDCDDDEDF
E0E1E2E3E4E5E6E7 E8E9EAEBECEDEEEF F0F1F2F3F4F5F6F7 F8F9FAFBFCFDFEFF

Register I/O

03B0h, 03B2h, 03B4h, 03B6h: CRTC address register.

Write a CRTC register number (0 to 11h) to this port to select the CRTC register that will appear at port 03B5h. For details of the registers, see the 6845 datasheet.

These addresses are partially decoded on a real MDA, so that any even- numbered address between 03B0h and 03B7h will get you the CRTC address register. But the official register to use is 03B4h.

This is a write-only register.

03B1h, 03B3h, 03B5h, 03B7h: CRTC register read/write.

This gives access to the selected CRTC data register. Most CRTC registers are write only; some are read/write or read-only. As with the address register, this is partially decoded; so although the official address is port 03B5h, it also appears at the other odd-numbered addresses between 03B0h and 03B7h.

03B8h: Mode Control Register

On a genuine MDA, this is a write-only register. Four of its bits can be set, but only two are any use:

Bit 5: 1 to enable blinking, 0 to disable it.

If bit 5 is 1, characters with attribute bit 7 set will blink. If not, they will have high intensity background.

Bit 3: 1 to enable video output, 0 to disable it.

If bit 3 is 0, screen output will not be shown. The usual use of this is if you're reprogramming the CRTC registers; disable video output beforehand and re-enable it after.

Bit 1: 1 for black and white.

This bit has no meaning, since the MDA always outputs in monochrome. The value written to it is stored (in chip U58) but nothing else on the card pays any attention to it.

Bit 0: 1 for high resolution mode.

For any sane purpose this bit must be set to 1. For details of what happens if it is set to zero, see High Resolution Mode.

Quite why the MDA implements bits 0 and 1 is not clear. Possibly IBM originally planned to make an expanded MDA that supported 40 columns and/or colour; or perhaps the CGA was designed first, and the MDA was based on the CGA design, including vestiges of the CGA's 40-column and colour support. See also colour MDA.

03BAh: Status Register

This is a read-only register. Only two bits of the value read from this port are defined:

(On a real IBM MDA, bits 7-4 are always 1, and bits 2-1 are always 0).

High Resolution Mode

According to IBM's technical manual (page 1-128), setting bit 0 of port 03B8h to 1 puts the MDA into "high-resolution mode". One might therefore deduce that setting it to 0 selects a "low-resolution mode". This is not the case.

Page 1-125 of the same manual warns:

To ensure proper initialization, the first command issued to the attachment must be to send to CRT control port 1 (hex 3B8), a hex 01, to set the high-resolution mode. If this bit is not set, then the processor access to the monochrome adapter must never occur. If the high-resolution bit is not set, the processor will stop running.

That is, if you take an MDA out of high-resolution mode, then any attempt to access its ports or memory could well cause the computer to hang.

If a zero is written to bit 0 of port 03B8h, the following MDA functions change:

From top to bottom, the four solder pads beside the clock crystal (in the middle of this picture) are:

This suggests that the intention was to have a 4-pin header on these pads for a second clock crystal (or other timing source) to be connected - or, possibly, to replace the existing crystal with one that could provide two different clock signals. This would then have provided a suitable pixel clock for a low-resolution text display.

The printer port

The printer port on a genuine IBM MDA behaves as follows:

Colour MDA

According to Programmer's Guide To PC And PS/2 Video Systems (by Richard Wilton, ISBN 1-55615-103-9), some IBM MDA cards included support for colour monitors:

Surprisingly, a few IBM MDAs generate color as well as monochrome output. Of course, the MDA's green monochrome display uses only two signals to control attributes (video on/off and intensity on/off); it ignores any color video signals. However, a color display that can use the MDA's 16.257 MHz horizontal sync and 50Hz vertical sync signals will display eight colors (with and without intensity) when attached to some (but not all) MDAs. Unfortunately, you can never be certain which MDA will turn out to be a color adapter in disguise.

I have no further information on this subject.

MDA Clones

Up to this point, I've concentrated on the genuine IBM MDA. This section gives a brief tour of how various MDA clones and supersets behave.

General notes

The "high resolution" bit (bit 0) of port 3B8h is nearly always ignored, and most cards work fine with it set to zero.

The undefined bits of port 3BAh may not be the same combination of zeroes and ones that they are on a real MDA; they may be all zeroes, for example. For Hercules-compatible cards (which are a superset of MDA), bit 7 is a vertical sync signal (1 when the screen is being drawn, 0 in the vertical blanking interval) and bit 1 returns lightpen status.

On a real MDA, the memory between B1000h and B7FFFh is filled with copies of B0000h - B0FFFh. Some clones (particularly Hercules cards) actually have 32k of RAM; others emulate the behaviour of a real MDA. I haven't yet seen an MDA clone that doesn't have anything between B1000h and B7FFFh, but that doesn't mean there isn't one.

Some MDA clones don't support dark and/or bright colours; they end up restricted to just normal, or normal plus bright.

3270 PC

The 3270 PC's video card supports programs which treat it as an MDA - either on its own colour monitor, or on a mono monitor. The resolution is the same as a normal MDA (720x350) but the font used is based on the 3270 terminal rather than the original MDA.

On a mono monitor, the attributes displayed are not quite the same as on a real MDA:

On a mono monitor, only one bit in the MDA mode control register has any effect - bit 5 (enable/disable blink). The others are ignored.

The video RAM repeats at 4k intervals all the way from 0B0000h to 0BFFFFh.

On a colour monitor, the attributes in MDA mode act as colours (bits 0-2=foreground, bits 4-6=background, bit 7=blink).

The extra video mode 30h (720x350 graphics) can be used on an MDA monitor. So can the 3270 emulation features.

Amstrad PPC / PC20

The Amstrad PPC has a chipset that can emulate MDA or CGA - either driving a normal monitor, or its internal LCD. The desktop version (PC20 aka Sinclair PC200) uses a similar system, but only supports an external monitor.

Hercules

Most MDA clones implement some form of Hercules-compatible graphics. The main differences for a Hercules-compatible card are:

One card I have encountered, which appears to be a Hercules clone of Eastern European origin, has a further capability - two ROM fonts, selectable in software. These options are controlled in a similar manner to other extended features in the Hercules: Bit 2 of port 3BFh must be set to enable the feature, and then Bit 4 of port 3B8h selects which font to use. The card ID in bits 6-4 of port 03BAh has all three bits set.


John Elliott 6 November 2005