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:
- Intel 80C88 (low power 8088) at 4.77MHz
- 256k RAM (expandable to 512k; later models up to 640k)
- Liquid Crystal Display, capable of emulating CGA or MDA. Later models had a backlighting option. This display can be unplugged if there's an external monitor attached (see below).
- Two 720k 3.5" floppy drives. The Convertible was the first IBM PC to have 3.5" drives; they look like PS/2 drives, with a big blue eject button.
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:
- Internal modem
- Printer
- Parallel/serial interface
- External monitor interface. This has a nonstandard pinout, so without further cable adaptors the only suitable monitors would be the ones specially made for the Convertible. These monitors had special stands so that, once the built-in LCD was removed, the Convertible fitted neatly under the monitor.
- Speech interface (?)
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.
Software
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:
- If the background colour is anything other than 0, the character displays in reverse video.
- If the foreground and background colours are the same, the character is not displayed.
- If the foreground colour is displayed in high intensity, this can either be ignored, or displayed in reverse video, or underlined, or in the alternative font (see Character Generator below).
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:
- BL=0: 77h
- BL=1: 7Fh
- BL=2: F7h
- BL=3: FFh
When the LCD is emulating an MDA:
- Attributes 0, 80, 7F and FF display as blank.
- Attributes 8, 88, 77 and F7 display as solid.
- Attributes 1, 9, 81 and 89 have underlines.
- Attributes 70 and F0 display in reverse video.
- All attributes with bit 3 set are high intensity, and display according to the options set above.
- All attributes with bit 7 set blink.
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 font | IBM CGA font |
---|---|
![]() |
![]() |
It's possible to load new characters by using INT 10h with:
- AX = 1400h
- ES:DI = address of font
- BH = character height (usually 8 unless you've done something really weird)
- BL = 0 to load main font, 1 to load alternate font
- CX = number of characters to load
- DX = number of first character to load
To reset the font to defaults, use:
- AX = 1401h
- BL = 0 to load main font, 1 to load alternate font
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,alTo 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:
- Let X be byte 20h of the CMOS memory.
- 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.
- 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:
- Bit 0, if current display is LCD in CGA mode.
- Bit 1, if current display is LCD in MDA mode.
- Bit 2, if current display is external CGA.
- Bit 3, if current display is external MDA.
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:
- If bit 2 of byte 20h is 1 and bit 1 of byte 22h is 0, alternative display is external CGA.
- If bit 3 of byte 20h is 1 and bit 2 of byte 22h is 0, alternative display is external MDA.
- In all other cases, there is no alternative display.
Links
- http://ohlandl.ipv7.net/5140/5140.html
- 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.
- http://www.computercloset.org/IBMPCConvertible.htm
- Shows pictures of the Convertible with all its accessories and one of the special monitors.
John Elliott 29 September 2005