3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
4 <META NAME="Author" CONTENT="Joshua Neal">
5 <META NAME="Description" CONTENT="Pure VGA/SVGA hardware programming (registers, identification, and other low-level stuff.)">
6 <META NAME="KeyWords" CONTENT="VGA SVGA hardware video programming">
7 <TITLE>VGA/SVGA Video Programming--External Regsters</TITLE>
12 <CENTER><A HREF="../home.htm">Home</A> <A HREF="vga.htm#register">Back</A>
13 <HR WIDTH="100%"><B>Hardware Level VGA and SVGA Video Programming Information
16 <CENTER>External Regsters</CENTER>
19 <HR WIDTH="100%"></CENTER>
21 The External Registers (sometimes
22 called the General Registers) each have their own unique I/O location in
23 the VGA, although sometimes the Read Port differs from the Write port,
24 and some are Read-only.. See the <A HREF="vgareg.htm">Accessing the VGA
25 Registers</A> section for more detals.
28 Port 3CCh/3C2h -- <I>Miscellaneous Output Register</I></LI>
31 Port 3CAh/3xAh -- <I>Feature Control Register</I></LI>
34 Port 3C2h -- <I>Input Status #0 Register</I></LI>
37 Port 3xAh -- <I>Input Status #1 Register</I></LI>
40 <TABLE BORDER WIDTH="600" CELLPADING="2" >
41 <CAPTION ALIGN=TOP><A NAME="3CCR3C2W"></A><B>Miscellaneous Output Register
42 (Read at 3CCh, Write at 3C2h)</B></CAPTION>
44 <TR ALIGN=CENTER VALIGN=CENTER>
62 <TR ALIGN=CENTER VALIGN=CENTER>
63 <TD WIDTH="75">VSYNCP</TD>
65 <TD WIDTH="75">HSYNCP</TD>
67 <TD WIDTH="75">O/E Page</TD>
71 <TD COLSPAN="2" WIDTH="150">Clock Select</TD>
73 <TD WIDTH="75">RAM En.</TD>
75 <TD WIDTH="75">I/OAS</TD>
79 <UL><B>VSYNCP -- Vertical Sync Polarity<BR>
80 </B>"<I>Determines the polarity of the vertical sync pulse and can be used
81 (with HSP) to control the vertical size of the display by utilizing the
82 autosynchronization feature of VGA displays.</I>
83 <BR><I> = 0 selects a positive vertical retrace sync pulse.</I>"
84 <BR><B>HSYNCP -- Horizontal Sync Polarity<BR>
85 </B>"<I>Determines the polarity of the horizontal sync pulse.</I>
86 <BR><I> = 0 selects a positive horizontal retrace sync pulse.</I>"
87 <BR><B>O/E Page -- Odd/Even Page Select<BR>
88 </B>"<I>Selects the upper/lower 64K page of memory when the system is in
89 an eve/odd mode (modes 0,1,2,3,7).</I>
90 <BR><I> = 0 selects the low page</I>
91 <BR><I> = 1 selects the high page</I>"
93 <B>Clock Select</B></LI>
95 <BR>This field controls the selection of the dot clocks used in driving
96 the display timing. The standard hardware has 2 clocks available
97 to it, nominally 25 Mhz and 28 Mhz. It is possible that there may
98 be other "external" clocks that can be selected by programming this register
99 with the undefined values. The possible valuse of this register are:
102 00 -- select 25 Mhz clock (used for 320/640 pixel wide modes)</LI>
105 01 -- select 28 Mhz clock (used for 360/720 pixel wide modes)</LI>
108 10 -- undefined (possible external clock)</LI>
111 11 -- undefined (possible external clock)</LI>
113 <B>RAM En. -- RAM Enable<BR>
114 </B>"<I>Controls system access to the display buffer.</I>
115 <BR><I> = 0 disables address decode for the display buffer from the
117 <BR><I> = 1 enables address decode for the display buffer from the
119 <BR><B>I/OAS -- Input/Output Address Select<BR>
120 </B>"<I>This bit selects the CRT controller addresses. When set to 0, this
121 bit sets the CRT controller addresses to 0x03Bx and the address for the
122 Input Status Register 1 to 0x03BA for compatibility withthe monochrome
123 adapter. When set to 1, this bit sets CRT controller addresses to
124 0x03Dx and the Input Status Register 1 address to 0x03DA for compatibility
125 with the color/graphics adapter. The Write addresses to the Feature Control
126 register are affected in the same manner.</I>"</UL>
128 <TABLE BORDER WIDTH="600" CELLPADING="2" >
129 <CAPTION ALIGN=TOP><A NAME="3CAR3xAW"></A><B>Feature Control Register (Read
130 at 3CAh, Write at 3BAh (mono) or 3DAh (color))</B></CAPTION>
132 <TR ALIGN=CENTER VALIGN=CENTER>
133 <TD WIDTH="75">7</TD>
135 <TD WIDTH="75">6</TD>
137 <TD WIDTH="75">5</TD>
139 <TD WIDTH="75">4</TD>
141 <TD WIDTH="75">3</TD>
143 <TD WIDTH="75">2</TD>
145 <TD WIDTH="75">1</TD>
147 <TD WIDTH="75">0</TD>
150 <TR ALIGN=CENTER VALIGN=CENTER>
163 <TD WIDTH="75">FC1</TD>
165 <TD WIDTH="75">FC0</TD>
171 <B>FC1 -- Feature Control bit 1<BR>
172 </B>"<I>All bits are reserved.</I>"</LI>
175 <B>FC2 -- Feature Control bit 0<BR>
176 </B>"<I>All bits are reserved.</I>"</LI>
179 <TABLE BORDER WIDTH="600" CELLPADING="2" >
180 <CAPTION ALIGN=TOP><A NAME="3C2R"></A><B>Input Status #0 Register (Read-only
181 at 3C2h)</B></CAPTION>
183 <TR ALIGN=CENTER VALIGN=CENTER>
184 <TD WIDTH="75">7</TD>
186 <TD WIDTH="75">6</TD>
188 <TD WIDTH="75">5</TD>
190 <TD WIDTH="75">4</TD>
192 <TD WIDTH="75">3</TD>
194 <TD WIDTH="75">2</TD>
196 <TD WIDTH="75">1</TD>
198 <TD WIDTH="75">0</TD>
201 <TR ALIGN=CENTER VALIGN=CENTER>
208 <TD WIDTH="75">SS</TD>
220 <UL><B>SS - Switch Sense<BR>
221 </B>"<I>Returns the status of the four sense switches as selected by the
222 CS field of the Miscellaneous Output Register.</I>"</UL>
224 <TABLE BORDER WIDTH="600" CELLPADING="2" >
225 <CAPTION ALIGN=TOP><A NAME="3xAR"></A><B>Input Status #1 Register (Read
226 at 3BAh (mono) or 3DAh (color))</B></CAPTION>
228 <TR ALIGN=CENTER VALIGN=CENTER>
229 <TD WIDTH="75">7</TD>
231 <TD WIDTH="75">6</TD>
233 <TD WIDTH="75">5</TD>
235 <TD WIDTH="75">4</TD>
237 <TD WIDTH="75">3</TD>
239 <TD WIDTH="75">2</TD>
241 <TD WIDTH="75">1</TD>
243 <TD WIDTH="75">0</TD>
246 <TR ALIGN=CENTER VALIGN=CENTER>
255 <TD WIDTH="75">VRetrace</TD>
261 <TD WIDTH="75">DD</TD>
265 <UL><B>VRetrace -- Vertical Retrace<BR>
266 </B>"<I>When set to 1, this bit indicates that the display is in a vertical
267 retrace interval.This bit can be programmed, through the Vertical Retrace
268 End register, to generate an interrupt at the start of the vertical retrace.</I>"
269 <BR><B>DD -- Display Disabled<BR>
270 </B>"<I>When set to 1, this bit indicates a horizontal or vertical retrace
271 interval. This bit is the real-time status of the inverted 'display enable'
272 signal. Programs have used this status bit to restrict screen updates to
273 the inactive display intervals in order to reduce screen flicker. The video
274 subsystem is designed to eliminate this software requirement; screen updates
275 may be made at any time without screen degradation.</I>"</UL>
276 Notice: All trademarks used or referred to on this page are the property
277 of their respective owners.
278 <BR>All pages are Copyright © 1997, 1998, J. D. Neal, except where
279 noted. Permission for utilization and distribution is subject to the terms
280 of the <A HREF="license.htm">FreeVGA Project Copyright License</A>.