Vintage PC pages
Home -> Vintage PCs -> IBM 5140

The IBM 5140 (PC Convertible)

The Convertible is IBM's first (and, for a long time, last) attempt at a true laptop. Unlike the computer it superseded (the 5155 "Portable") it did actually run on batteries and was actually lighter than a desktop PC.

The specification is roughly:

The only external connector other than the power supply is for the expansion bus, which is unique to the Convertible. As far as I know, the only expansion options were:

All these apart from the modem plugged directly onto the back of the Convertible. There was no 'docking station' which could take arbitrary ISA cards, and no way of adding a hard drive.

Power Supply

The 5140 takes 15v at around 2.7 amps. If the original power supply is missing, Maplin Electronics sell a suitable substitute - the Sunpower SP2101 universal notebook power supply (number N94AA in their catalogue). Use the plug marked 5.5 x 2.5; since the bodies of the supplied plugs are rather bulky, you'll have to trim it with a craft knife to make it fit in the socket. The polarity used by this PSU (centre positive) is the correct one.


The 5140 was supplied with a number of applets, accessed from a menu program called the Application Selector. This program is specific to the Convertible; it checks the machine type in the BIOS, and doesn't run unless it is 0F9h. Screenshots of the Application Selector are available here.

Video Hardware

Attribute mapping

The LCD is a black-and-white device, and so when it is emulating a CGA, it has to map the various combinations of colours to black and white. The method it uses is:

The method of displaying bright colours is set using the 'System Profile' applet, or by using INT 10h with AX=1402h and BL = 0 (Ignore), 1 (Reverse Video), 2 (Underline), 3 (Alt. font). Internally, this writes the following value to CRTC register 20:

When the LCD is emulating an MDA:

Character Generator

Unlike a real CGA, the Convertible's LCD has a redefinable character set. This is the reason for the LCD.CPI file that was distributed with some versions of DOS; it contained various codepages, but with character shapes based on the LCD font rather than the normal EGA/CGA fonts:

IBM 5140 fontIBM CGA font
[LCD font] [CGA font]

It's possible to load new characters by using INT 10h with:

To reset the font to defaults, use:

At the hardware level, the character shapes are stored in a second bank of video memory, which to be found at the same address as video RAM: B0000h (if the LCD is emulating an MDA) or B8000h (if it's emulating a CGA). To select this memory bank, write 0 to port 74h, and then set bit 4 of port 75h:

	mov	al,0
	out	74h,al
	in	al,75h
	or	al,10h
	out	75h,al
To change back to the normal video RAM, do the same but reset bit 4 of port 75h.

Display type detection

If INT 10h is called with AH=15h, this will return AX = model number of alternative display, and ES:DI -> parameters for main display.

The model number is 0 for none, 5140h for the built-in LCD, 5153h for CGA and 5151h for MDA.

The parameter table pointed to by ES:DI is formed:

	DW	main display model number, as above
	DW	vertical pixels per metre
	DW	horizontal pixels per metre
	DW	total vertical pixels
	DW	total horizontal pixels
	DW	horizontal pixel separation, micrometres
	DW	vertical pixel separation, micrometres

The current monitor type is found as follows:

  1. Let X be byte 20h of the CMOS memory.
  2. Check if the CRTC is at 3D4h. If it is, then bit 0 of X is 0 for external CGA, 1 for built-in LCD in CGA mode.
  3. Otherwise, bit 1 of X is 0 for external MDA, 1 for built-in LCD in MDA mode.

The alternate display is found by taking byte 20h of the CMOS memory and zeroing the bit corresponding to the active display:

If the result is 0, there was only one display in the system, so there's no alternative display. If either of the bottom two bits is set, the alternative display is the LCD. Otherwise, read byte 22h of CMOS:

A very informative site, with board layouts, lists of model variations, and records of discussions about hardware modifications that can and can't be done.
Shows pictures of the Convertible with all its accessories and one of the special monitors.

John Elliott 29 September 2005