How VGA Sequencer Toggles 8 and 9 Dot Characters
The Video Graphics Array (VGA) architecture toggles between 8-dot and 9-dot character widths using the Sequencer's Clocking Mode register. By altering a single control bit within this register, the VGA hardware changes the frequency division of the master dot clock, determining whether each text column spans eight or nine horizontal pixels, which directly alters the active horizontal resolution and text appearance.
Accessing the Clocking Mode Register
The Sequencer controls the internal timing and character clock generation of the VGA subsystem. Accessing the Clocking Mode register requires writing to two distinct I/O port addresses:
- Sequencer Index Register (
0x3C4): Write the index value0x01to point to the Clocking Mode register. - Sequencer Data Register (
0x3C5): Read or write the configuration byte for the Clocking Mode register.
The Role of Bit 0
Bit 0 of Sequencer Register 0x01 controls the 8/9 Dot
Clocks mode:
- Bit 0 = 0 (9 Dot Clocks): The Sequencer divides the dot clock by 9 to generate each character clock cycle. This mode is the standard default for monochrome and 720×400 color text modes (such as standard VGA 80×25 text mode), resulting in a full 720-pixel horizontal display width (80 columns × 9 pixels).
- Bit 0 = 1 (8 Dot Clocks): The Sequencer divides the dot clock by 8 for each character clock cycle. This setting reduces the active display width to 640 horizontal pixels (80 columns × 8 pixels), commonly used in 640×480 graphics modes or legacy 640-pixel text modes.
Generation of the 9th Dot
VGA character font bitmaps are natively stored in font memory as 8 bits (1 byte) wide per scanline. When 9-dot mode is engaged (Bit 0 = 0), the hardware must synthesize the missing ninth pixel:
- Standard Characters: For most ASCII characters
(specifically character codes
0x00through0xBFand0xE0through0xFF), the hardware automatically sets the 9th dot to the current background color, creating horizontal spacing between adjacent glyphs. - Line-Drawing Characters: For box-drawing characters
in the range
0xC0through0xDF, horizontal lines must connect seamlessly. If Bit 2 (Line Graphics Enable) of the Attribute Controller Mode Control Register (0x3C0/0x3C1, Index0x10) is set to 1, the hardware automatically replicates the value of the 8th pixel into the 9th pixel position instead of using the background color.
Clock and Timing Impact
Toggling Bit 0 directly alters how many pixel pulses constitute a character block without modifying the master pixel oscillator frequency. Switching from 9-dot to 8-dot mode without adjusting the horizontal display timings in the Cathode Ray Tube Controller (CRTC) increases the visual refresh rate slightly and shrinks the overall width of the displayed image on an analog display.