#$K+Miscellaneous Information

Pin assignments, screen colors, scan codes, and control code acronyms.

This screen gives access to:
  Serial Port Pin Assignments
  Printer Port Pin Assignments
  Game Port Pin Assignments
  Colors on EGA/VGA display
  Keyboard Scan Codes
  Acronyms for ASCII Control Codes

Compiled from INT2GUID.ADD in the INT2GUID.ZIP package included in the 
Interrupt List. 
Copyright © 1991-1994 Bent Lynggaard
#$K+Serial Port Pin Assignments

RS-232-C serial port (COM port) pin assignments.
*n = PC pin, n is pin number on the 9 pin AT connector.
> = from PC or DTE; < = to PC or DTE. DTE = Data Terminal Equipment.

    1 FG    Frame ground            14 TD2 > Secondary TD
*3  2 TD  > Transmit Data           15 TC  < Transmission Signal Timing
*2  3 RD  < Receive Data            16 RD2 < Secondary RD
*7  4 RTS > Request To Send         17 RC  < Receiver Signal Timing
*8  5 CTS < Clear To Send           18       (unassigned)
*6  6 DSR < Data Set Ready          19 RS2 > Secondary RTS
*5  7 SG    Signal ground        *4 20 DTR > Data Terminal Ready
*1  8 DCD < Data Carrier Detect     21 SQ  < Signal Quality Detector
    9       (test)               *9 22 RI  < Ring Indicator
   10       (test)                  23 DRS = Data signal Rate Selector
   11       (unassigned)            24 TT  > Transmit Signal Timing
   12 CD2 < Secondary DCD           25       (unassigned)
   13 CT2 < Secondary CTS

See also INT 14.

Printer Port and Game Port pin assignments are also available.

Back to Miscellaneous Information index.
#$K+Printer Port Pin Assignments

Printer port (parallel port, LPT port) pin assignments.
25 pin PC printer port and 36 pin Centronic port.
> = from PC; < = to PC. Pins 1-9 are bidirectional on PS-2 models in ext. mode.

 Data                    Gnd          Data                    Gnd
  1 1 > ^Strobe         19 19         10 10 < ^Acknowledge   24 28
  2 2 > Data Bit 0      20 20         11 11 < Busy           24 29
  3 3 >  "    "  1      20 21         12 12 < Paper End      25 30
  4 4 >  "    "  2      21 22         13 13 < Select         18 16,33
  5 5 >  "    "  3      21 23         14 14 > ^Auto Feed xt  18 16,33
  6 6 >  "    "  4      22 24         32 15 < ^Error         18 16,33
  7 7 >  "    "  5      22 25         31 16 > ^Initialize    18 16,33
  8 8 >  "    "  6      23 26         36 17 > ^Select In     18 16,33
  9 9 >  "    "  7      23 27

See also INT 17.

Serial Port and Game Port pin assignments are also available.

Back to Miscellaneous Information index.
#$K+Game Port Pin Assignments

Game port pin assignments. (15 pins in 2 rows)

  1,8,9: +5 V
  15: +5 V or Midi RXD
  4,5: 0 V (ground)
  12: 0 V or Midi TXD
  2:  Switch A-1                Switches are sensed active when shorted
  3:  X-position A              to ground.
  6:  Y-position A
  7:  Switch A-2                Position sensors are variable resistors
  10: Switch B-1                0 ohms - 250 kiloohms from the position
  11: X-position B              pins to +5 V.
  13: Y-position B
  14: Switch B-2

See also INT 15 function 84.

Serial Port and Printer Port pin assignments are also available.

Back to Miscellaneous Information index.
#$K+Colors on EGA/VGA display

Screen colors.

 Normal colors       Bright colors          Attribute bits              
 0 00 Black          8 08 Dark grey         7 normal    Foreground blink
 1 01 Blue           9 09 Light blue        7 alternate Background bright
 2 02 Green         10 0A Light green       6-4         Background color
 3 03 Cyan          11 0B Light cyan        3 normal    Foreground bright
 4 04 Red           12 0C Light red         3 alternate Alternate char. set
 5 05 Magenta       13 0D Light magenta     2-0         Foreground color
 6 06 Brown         14 0E Yellow
 7 07 White (grey)  15 0F Bright (white)

Normal/alternate function:       Set                     Read
  Attribute bit 7:         INT 10 AX=1003    INT 10 AH=1B offs. 2D bit 5
  Attribute bit 3:         INT 10 AX=1103*   INT 10 AH=1B offs. 2B<>offs. 2C

* BL bits 0,1,4<>bits 2,3,5. The bright attribute is still active, it can be
disabled/enabled by INT 10 AX=1000 BX=0712/0F12.

Back to Miscellaneous Information index.
#$K+Keyboard Scan Codes

Scan codes: special keys. Num Lock off (on: swap Plain/Shift col. Up - Del).
*: Not INT 16 AH = 00. See also next page.

       Plain  Shift   Ctrl    Alt         Plain  Shift   Ctrl    Alt
    Up  4800   4838    --     --       F1  3B00   5400   5E00   6800        
  Down  5000   5032    --     --       F2  3C00   5500   5F00   6900
  Left  4B00   4B34   7300    --       F3  3D00   5600   6000   6A00
 Right  4D00   4D36   7400    --       F4  3E00   5700   6100   6B00
  Home  4700   4737   7700    --       F5  3F00   5800   6200   6C00
   End  4F00   4F31   7500    --       F6  4000   5900   6300   6D00
  PgUp  4900   4939   8400    --       F7  4100   5A00   6400   6E00
  PgDn  5100   5133   7600    --       F8  4200   5B00   6500   6F00
   Ins  5200   5230    --     --       F9  4300   5C00   6600   7000
   Del  5300   532E    --     --      F10  4400   5D00   6700   7100
   Esc  011B   011B   011B  *0100     F11 *8500  *8700  *8900  *8B00
   Tab  0F09   0F00  *9400  *A500     F12 *8600  *8800  *8A00  *8C00
  BkSp  0E08   0E08   0E7F  *0E00
Return  1C0D   1C0D   1C0A  *1C00   Enter  1C0D   1C0D   1C0A    --
 Space  3920   3920   3920   3920

Scan codes: special keys extended codes. Num Lock off. INT 16 AH = 10
             Numeric Keypad                     Special Keypad

       Plain  Shift   Ctrl    Alt         Plain  Shift   Ctrl    Alt
    Up  4800   4838   8D00   *--           48E0   48E0   8DE0   9800
  Down  5000   5032   9100   *--           50E0   50E0   91E0   A000
  Left  4B00   4B34   7300   *--           4BE0   4BE0   73E0   9B00
 Right  4D00   4D36   7400   *--           4DE0   4DE0   74E0   9D00
  Home  4700   4737   7700   *--           47E0   47E0   77E0   9700
   End  4F00   4F31   7500   *--           4FE0   4FE0   75E0   9F00
  PgUp  4900   4939   8400   *--           49E0   49E0   84E0   9900
  PgDn  5100   5133   7600   *--           51E0   51E0   76E0   A100
   Ins  5200   5230   9200   *--           52E0   52E0   9200   A200
   Del  5300   532E   9300    --           53E0   53E0   93E0   A300
   5    4C00   4C35   8F00   *--   * = compose
   /    E02F   E02F   9500   A400
   *    372A   372A   9600   3700
   -    4A2D   4A2D   8E00   4A00
   +    4E2B   4E2B   9000   4E00   Enter  E00D   E00D   E00A   A600

Scan codes: digits, punctuation marks, etc.
NB! US keyboard. The high byte may differ if a national keyboard is active,
and the symbols may not be paired as in the table.
*: Not INT 16 AH = 00. +: See also previous page.

     Plain  Shift   Ctrl    Alt         Plain  Shift   Ctrl    Alt
 ` ~  2960   297E    --   *2900     [ {  1A5B   1A7B   1A1B  *1A00
 1 !  0231   0221    --    7800     ] }  1B5D   1B7D   1B1D  *1B00
 2 @  0332   0340   0300   7900     ; :  273B   273A    --   *2700
 3 #  0433   0423    --    7A00     ' "  2827   2822    --   *2800
 4 $  0534   0524    --    7B00     \ |  2B5C   2B7C   2B1C  *2B00
 5 %  0635   0625    --    7C00     \ |  565C   567C    --     --  102nd key
 6 ^  0736   075E   071E   7D00     , <  332C   333C    --   *3300
 7 &  0837   0826    --    7E00     . >  342E   343E    --   *3400
 8 *  0938   092A    --    7F00     / ?  352F   353F    --   *3500
 9 (  0A39   0A28    --    8000    +/    352F   352F    --     --  numeric
 0 )  0B30   0B29    --    8100    +*    372A   372A    --     --  numeric
 - _  0C2D   0C5F   0C1F   8200    +-    4A2D   4A2D    --     --  numeric
 = +  0D3D   0D2B    --    8300    ++    4E2B   4E2B    --     --  numeric

Scan codes: letters. Caps Lock off. (Caps Lock on: swap Plain/Shift columns)
NB! US keyboard. The high byte may differ if a national keyboard is active.

     Plain  Shift   Ctrl    Alt         Plain  Shift   Ctrl    Alt
   a  1E61   1E41   1E01   1E00       n  316E   314E   310E   3100
   b  3062   3042   3002   3000       o  186F   184F   180F   1800
   c  2E63   2E43   2E03   2E00       p  1970   1950   1910   1900
   d  2064   2044   2004   2000       q  1071   1051   1011   1000
   e  1265   1245   1205   1200       r  1372   1352   1312   1300
   f  2166   2146   2106   2100       s  1F73   1F53   1F13   1F00
   g  2267   2247   2207   2200       t  1474   1454   1414   1400
   h  2368   2348   2308   2300       u  1675   1655   1615   1600
   i  1769   1749   1709   1700       v  2F76   2F56   2F16   2F00
   j  246A   244A   240A   2400       w  1177   1157   1117   1100
   k  256B   254B   250B   2500       x  2D78   2D58   2D18   2D00
   l  266C   264C   260C   2600       y  1579   1559   1519   1500
   m  326D   324D   320D   3200       z  2C7A   2C5A   2C1A   2C00

Back to Miscellaneous Information index.
#$K+Acronyms for ASCII Control Codes

Alphabetic list of control codes (C0) and extended control codes (C1).

ACK=  6    DEL=127    FE3= 11    IS4= 28    PU2=146    STX=  2    US = 31
APC=159    DLE= 16    FE4= 12    LF = 10    RI =141    SUB= 26    VT = 11
BEL=  7    EM = 25    FE5= 13    LS0= 15    RS = 30    SYN= 22    VTS=138
BS =  8    ENQ=  5    FF = 12    LS1= 14    SI = 15    TC1=  1
CAN= 24    EOT=  4    FS = 28    MW =149    SO = 14    TC2=  2
CCH=148    EPA=151    GS = 29    NAK= 21    SOH=  1    TC3=  3
CR = 13    ESA=135    HT =  9    NEL=133    SP = 32    TC4=  4
CSI=155    ESC= 27    HTJ=137    NUL=  0    SPA=150    TC5=  5
DC1= 17    ETB= 23    HTS=136    OSC=157    SS2=142    TC6=  6
DC2= 18    ETX=  3    IND=132    PLD=139    SS3=143    TC7= 16
DC3= 19    FE0=  8    IS1= 31    PLU=140    SSA=134    TC8= 21
DC4= 20    FE1=  9    IS2= 30    PM =158    ST =156    TC9= 22
DCS=144    FE2= 10    IS3= 29    PU1=145    STS=147    TCx= 23

This list includes the graphics codes (G0):
 32 20 SP  Space                       127 7F DEL Delete

Control codes ASCII 0 - 31 (C0).
Often symbolized by ^ + char. @ - _, e.g. ^M=CR.

  0 00 @ NUL Null                       16 10 P DLE (TC7) Data Link Escape
  1 01 A SOH (TC1) Start Of Heading     17 11 Q DC1 Device Control 1, Xon
  2 02 B STX (TC2) Start of Text        18 12 R DC2 Device Control 2
  3 03 C ETX (TC3) End of Text          19 13 S DC3 Device Control 3, Xoff
  4 04 D EOT (TC4) End Of Transmission  20 14 T DC4 Device Control 4
  5 05 E ENQ (TC5) Enquiry              21 15 U NAK (TC8) Not Acknowledge
  6 06 F ACK (TC6) Acknowledge          22 16 V SYN (TC9) Synchronous idle
  7 07 G BEL Bell                       23 17 W ETB (TC10) End Transm. Block
  8 08 H BS  (FE0) Back Space           24 18 X CAN Cancel
  9 09 I HT  (FE1) Horizontal Tabulat.  25 19 Y EM  End of Medium
 10 0A J LF  (FE2) Line Feed            26 1A Z SUB Substitute character
 11 0B K VT  (FE3) Vertical Tabulation  27 1B [ ESC Escape seq. introd.
 12 0C L FF  (FE4) Form Feed            28 1C \ FS  (IS4) File Separator
 13 0D M CR  (FE5) Carriage Return      29 1D ] GS  (IS3) Group Separator
 14 0E N SO  (LS1) Shift Out            30 1E ^ RS  (IS2) Record Separator
 15 0F O SI  (LS0) Shift In             31 1F _ US  (IS1) Unit Separator

TC=Transmission Control
FE=Format Effector
LS=Locking Shift
IS=Information Separator

Extended control codes 128 - 159 (C1).
Sometimes emulated by ESC + char. @ - _, e.g. Ansi code "ESC[" = "CSI"

128 80 @     (unassigned)              144 90 P DCS Device Control String
129 81 A     (unassigned)              145 91 Q PU1 Private Use 1
130 82 B     (unassigned)              146 92 R PU2 Private Use 2
131 83 C     (unassigned)              147 93 S STS Set Transmit State
132 84 D IND Index                     148 94 T CCH Cancel Character
133 85 E NEL Next Line                 149 95 U MW  Message Waiting
134 86 F SSA Start Selected Area       150 96 V SPA Start Protected Area
135 87 G ESA End Selected Area         151 97 W EPA End Protected Area
136 88 H HTS Horizontal Tab. Set       152 98 X     (unassigned)
137 89 I HTJ Horiz. Tab. w. Justif.    153 99 Y     (unassigned)
138 8A J VTS Vertical Tab. Set         154 9A Z     (unassigned)
139 8B K PLD Partial Line Down         155 9B [ CSI Control Seq. Introd.
140 8C L PLU Partial Line Up           156 9C \ ST  String Terminator
141 8D M RI  Reverse Index             157 9D ] OSC Operating System Command
142 8E N SS2 Single Shift G2           158 9E ^ PM  Privacy Message
143 8F O SS3 Single Shift G3           159 9F _ APC Application Program Cmd.

Back to Miscellaneous Information index.