Commodore‎ > ‎

ASCII-X

Most of the CBM 8-bit computers come with two character sets.  One of them has been referred to as the uppercase/graphics character set, and it is usally the default set.  It does not have any lower-case letters!  The letters (that it does have), the numbers, and almost all of the punctuation characters match those of ASCII, the American Standard Code for Information Interchange. 

Like many 8-bit computers, CBM also extends the 7-bit ASCII definition to 8-bits.  There are many extensions to ASCII, generally incompatible with one another.  Anyway, Commodore has their own, and I call it ASCII-X to distinguish it from the other character set, PETSCII.  [The currently most popular character code (UTF-8) is a sub-set of ASCII.]
 
An extension from 7-bits to 8-bits should add 128 codes;  well it does, but half of them are duplicates in Commodore's extended ASCII!  So ASCII-X only adds 64 new "characters"; 32 of them are graphical symbols and 32 are control codes.  ASCII-X has 64 graphical symbols, however, because there are no lower-case characters.  Anyway, you'll see a lot of duplicates if you examine the tables below.  To make matters worse, when the C64 came out, there was a problem with color "smearing" with the thin vertical characters.  So all vertical characters were made two pixels wide (instead of one).  This made a few codes into duplicates... but now the horizontal lines wouldn't mesh well with the new vertical ones... so the horizontal lines were changed too... resulting in even more duplicates!  This was carried over to the TED series (C16 and Plus/4) and the C128 (which has a VIC-II like the C64). 
 
Technical note (okay to skip this paragraph).  The problem with color smearing isn't strictly the video chips, but also the fact these were designed as home computers to be connected to a TV, and broadcast standards limit the color information relative to luminance.  So this is more-or-less expected with the TED and VIC-II.  However the VDC of the C128 is perfectly capable of showing the "proper" font, but the US / International version has the same font as the Plus/4.  Nationalized versions (those with ASCII/DIN key) do have a "thin" character set, but I don't own one to test the fonts, relative to the original in the PET and VIC-20 (they do add special characters for the language/region they were designed for, so they would differ anyway).
 
Note the computer (at least BASIC and the KERNAL) use the same codes regardless of which character set the user chooses for display.  This can make things confusing.  Many official publications and magazine articles from back in the day just use the term ASCII without referring to the character set in use; in this case you should be skeptical.  I would assume they refer to ASCII-X if they did not specifically mention the other (lowercase/uppercase) character set, in which case I would infer the PETSCII set.
 
So here is a table listing the decimal and hexidecimal values of ASCII-X, the character itself (Glyph), and the ASCII and Unicode equivalants, if they exist.  Some of the codes do not normally print a character, but peform an action.  These are shown under Glyph with a description and the reverse-font character that may appear in some circumstances (so-called quote mode and insert mode).  Otherwise, the glyph is only present if it has a Unicode value, although some browsers may not render them correctly (may appear as a blank, or square box, or ?).  There are also notes that describe the action of some codes, a keyboard combination to generate it, and/or a description of some characters.  There are some difference in the layouts of the CBM machines, but they are mostly equivalant.  The descriptions for keyboard shortcuts are based on the VIC-20/C64/C128.  I've also broken the table up into blocks to hopefully highlight the structure of this character set, although some things just seem to defy logic. 
 
Block 0, Low Control Codes
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
0 00 @ null 0 NUL U+0000 key: Control+@
1 01 A nop     key: Control+A; ASCII SOH
2 02 B underline on (c128)     key: Control+B; ASCII STX
3 03 C nop     key: Control+C; ASCII ETX
4 04 D nop     key: Control+D; ASCII EOT
5 05 E white     key: Control+E; ASCII ENQ
6 06 F nop     key: Control+F; ASCII ACK
7 07 G bell 7 BEL   key: Control+G
8 08 H char lock on     key: Control+H; ASCII BS; Not C128: see code 11
9 09 I char lock off
tab (c128)
9 HT U+0009 key: Control+I, TAB; For C128 char-lock, see code 12
10 0A J line feed (C128) 10 LF U+000A key: Control+J; See also code 17
11 0B K char lock on (C128)     key: Control+K; ASCII VT
12 0C L char lock off (C128)     key: Control+L; ASCII FF
13 0D M carriage return 13 CR U+000D key: Control+M, Return, Enter; See also code 141
14 0E N go PETSCII     key: Control+N, Shift+C=; ASCII SO; See also code 142
15 0F O flash on (C128)     key: Control+O; ASCII SI; For C16 or Plus/4: see ???
16 10 P nop     key: Control+P; ASCII DLE
17 11 Q cursor down 10 U+000A key: Control+Q, CRSR ⇕, ⇩ ASCII DC1; See also 29, 145, 157
18 12 R reverse on     key: Control+R, Control+9; ASCII DC2
19 13 S home     key: Control+S, HOME; ASCII DC3
20 14 T delete 8 U+0008 key: Control+T, DEL; ASCII DC4
21 15 U nop     key: Control+U; ASCII NAK
22 16 V nop     key: Control+V; ASCII SYN
23 17 W nop     key: Control+W; ASCII ETB
24 18 X toggle Tab stop (C128)     key: Control+X, Shift+Tab; ASCII CAN
25 19 Y nop     key: Control+Y; ASCII EM
26 1A Z nop     key: Control+Z; ASCII SUB
27 1B [ escape (C128) 27 ESC U+001B key: Control+[, ESC
28 1C £ red     key: Control+3, Control+£; ASCII FS
29 1D ] cursor right     key: Control+], CRSR ⇔, ⇨; ASCII GS
30 1E green     key: Control+6, Control+↑; ASCII RS
31 1F blue     key: Control+7, Control+←; ASCII US
 
Block 1, Numbers and Punctuation
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
32 20
32 SP U+0020 key: Spacebar
33 21 ! 33 U+0021 key: Shift+1
34 22 " 34 U+0022 key: Shift+2
35 23 # 35 U+0023 key: Shift+3
36 24 $ 36 U+0024 key: Shift+4
37 25 % 37 U+0025 key: Shift+5
38 26 & 38 U+0026 key: Shift+6
39 27 ' 39 U+0027 key: Shift+7
40 28 ( 40 U+0028 key: Shift+8
41 29 ) 41 U+0029 key: Shift+9
42 2A * 42 U+002A  
43 2B + 43 U+002B  
44 2C , 44 U+002C  
45 2D - 45 U+002D  
46 2E . 46 U+002E  
47 2F / 47 U+002F  
48 30 0 48 U+0030  
49 31 1 49 U+0031  
50 32 2 50 U+0032  
51 33 3 51 U+0033  
52 34 4 52 U+0034  
53 35 5 53 U+0035  
54 36 6 54 U+0036  
55 37 7 55 U+0037  
56 38 8 56 U+0038  
57 39 9 57 U+0039  
58 3A : 58 U+003A  
59 3B ; 59 U+003B  
60 3C < 60 U+003C key: Shift+,
61 3D = 61 U+003D  
62 3E > 62 U+003E key: Shift+.
63 3F ? 63 U+003F key: Shift+/
 
Block 2, Uppercase Letters
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
64 40 @ 64 U+0040  
65 41 A 65 U+0041  
66 42 B 66 U+0042  
67 43 C 67 U+0043  
68 44 D 68 U+0044  
69 45 E 69 U+0045  
70 46 F 70 U+0046  
71 47 G 71 U+0047  
72 48 H 72 U+0048  
73 49 I 73 U+0049  
74 4A J 74 U+004A  
75 4B K 75 U+004B  
76 4C L 76 U+004C  
77 4D M 77 U+004D  
78 4E N 78 U+004E  
79 4F O 79 U+004F  
80 50 P 80 U+0050  
81 51 Q 81 U+0051  
82 52 R 82 U+0052  
83 53 S 83 U+0053  
84 54 T 84 U+0054  
85 55 U 85 U+0055  
86 56 V 86 U+0056  
87 57 W 87 U+0057  
88 58 X 88 U+0058  
89 59 Y 89 U+0059  
90 5A Z 90 U+005A  
91 5B [ 91 U+005B key: Shift + :
92 5C £   U+00A3 ASCII \
93 5D ] 93 U+005D key: Shift + ;
94 5E 94 U+2191 ASCII ^; On C16 and Plus/4, key: Shift+0
95 5F 95 U+2190 ASCII _
 
Block 3, Extended Graphics (Alternate)
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
96 60   U+2500 key: Shift+*; Horizontal bar at Y 5/8 (VIC-II/TED centered thick bar)
97 61   U+2660 key: Shift+A; Spade suit
98 62 ?   U+?? key: Shift+B; Vertical bar at X 4/8  (VIC-II/TED centered thick bar)
99 63 ?   U+?? key: Shift+C; Horizontal bar at Y 4/8 (VIC-II/TED centered thick bar)
100 64 ?   U+?? key: Shift+D; Horizontal bar at Y 3/8
101 65 ?   U+?? key: Shift+E; Horizontal bar at Y 2/8
102 66 ?   U+?? key: Shift+F; Horizontal bar at Y 6/8
103 67 ?   U+?? key: Shift+G; Vertical bar at X 3/8
104 68 ?   U+?? key: Shift+H; Vertical bar at X 6/8
105 69   U+256E key: Shift+I; Arc bottom to left
106 6A   U+2570 key: Shift+J; Arc top to right
107 6B   U+256F key: Shift+K; Arc top to left
108 6C   U+2599 key: Shift+L; Bottom left corner, similar to "L"
109 6D   U+2572 key: Shift+M; Diaganol top left to bottom right
110 6E   U+2571 key: Shift+N; Diaganol bottom left to top right
111 6F
  U+259B key: Shift+O; Top left corner, similar to "Γ"
112 70
  U+259C key: Shift+P; Top right corner, similar to "7")
113 71 (or )   U+2219 or U+2022 key: Shift+Q; Solid circle/bullet
114 72 ?   U+?? key: Shift+R; Horizontal bar at Y 7/8
115 73   U+2665 key: Shift+S; Heart suit
116 74 ?   U+?? key: Shift+T; Horizontal bar at X 2/8
117 75   U+256D key: Shift+U; Arc bottom to right
118 76   U+2573 key: Shift+V; Diaganol cross, similar to "X"
119 77   U+2218 key: Shift+W; Hollow circle/bullet
120 78   U+2663 key: Shift+X; Spade suit
121 79 ?   U+?? key: Shift+Y; Vertical bar at X 7/8
122 7A   U+2666 key: Shift+Z; Diamond suit
123 7B   U+253C key: Shift++; Cross, similar to "+"
124 7C (left half)   U+25A6 (left half) key: C=+-; Diaganol cross-hatch (left half)
125 7D 124 | U+2502 key: Shift+-; Vertical bar at X 5/8 (VIC-II/TED centered thick bar)
126 7E π   U+03C0 key: C=+^ or Shift+^; lower-case pi
127 7F   U+25E5 key: C=+*; Upper right triangle
 
Block 4, High Control Codes
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
128 80 nop     key: ???
129 81 orange (most)
dark purple (VDC)
    key: C=+1
130 82 ? underline off (c128)
flash on (Plus/4)
    key: Control+, (Plus/4)
131 83 ? function 9     key: Shift+STOP
132 84 ? function 10 (c128)
flash off (Plus/4)
    key: HELP (C128), Control+. (Plus/4)
133 85 ? function 1     key: F1
134 86 ? function 3     key: F3
135 87 ? function 5     key: F5
136 88 ? function 7     key: F7
137 89 function 2     key: F2
138 8A function 4     key: F4
139 8B function 6     key: F6
140 8C ? function 8     key: F8
141 8D carriage return 13 CR U+000D key: Shift+Return (ignored by BASIC); See also code 13
142 8E go ASCII-X     key: Shift+C=; See also code 14
143 8F ? flash off (C128)     key: ???; For C16 or Plus/4, see 132
144 90 ? black     key: Control+1
145 91 cursor up     key: Shift+CRSR ⇕, ⇧; See also 17, 29, 157
146 92 ? reverse off     key: Control+0
147 93 clear screen     key: Shift+HOME
148 94 ? insert     key: Shift+DEL
149 95 brown     key: C=+2
150 96 light red     key: C=+3
151 97 dark gray (VIC-II)
dark cyan (VDC)
    key: C=+4
152 98 med. gray (VIC-II)
dark gray (VDC)
    key: C=+5
153 99 ? light green     key: C=+6
154 9A light blue     key: C=+7
155 9B light gray     key: C=+8
156 9C ? purple (magenta)     key: Control+5
157 9D cursor left     key: Shift+CRSR ⇔, ⇨; See also 17, 29, 145
158 9E yellow     key: Control+8
159 9F cyan     key: Control+4
 
Block 5, Common Graphics (Primary)
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
160 A0   32 SP U+00A0 key: Shift+Spacebar; non-breaking space
161 A1   U+258C key: C=+K; right half block
162 A2   U+2584 key: C=+I; bottom half block
163 A3   U+2594 key: C=+T; top 1/8 block
164 A4   U+2581 key: C=+@; bottom 1/8 block
165 A5   U+258F key: C=+G; left 1/8 block (2/8 block on VIC-II and TED)
166 A6   U+25A9 key: C=++; diaganol cross-hatch
167 A7   U+2595 key: C=+M; right 1/8 block (2/8 block on VIC-II and TED)
168 A8 ?   U+??? key: C=+£; bottom half cross-hatch
169 A9   U+25E4 key: Shift+£; upper left triangle
170 AA   reverse U+258A key: C=+N; right 2/8 block (reverse Unicode left 6/8)
171 AB   U+251C key: C=+Q; East-pointing "T"
172 AC   U+2597 key: C=+D; bottom right block
173 AD   U+2514 key: C=+Z; corner up and right
174 AE   U+2510 key: C=+S; corner down and left
175 AF   U+2582 key: C=+P; bottom 2/8 block
176 B0   U+250C key: C=+A; corner down and right
177 B1   U+2534 key: C=+E; North-pointing "T"
178 B2   U+252C key: C=+R; South-pointing "T"
179 B3   U+2524 key: C=+W; West-pointing "T"
180 B4   U+258E key: C=+H; left 2/8 block
181 B5   U+258D key: C=+J; left 3/8 block
182 B6   reverse U+258B key: C=+L; right 3/8 block (reverse Unicode left 5/8)
183 B7   reverse U+2586 key: C=+Y; top 2/8 block (reverse Unicode bottom 6/8)
184 B8   reverse U+2585 key: C=+Y; top 3/8 block (reverse Unicode bottom 5/8)
185 B9   U+2583 key: C=+O; bottom 3/8 block
186 BA   U+259F key: Shift+@; Bottom right corner, similar to "L" mirror-X
187 BB   U+2596 key: C=+F; bottom left block
188 BC   U+259D key: C=+C; top right block
189 BD   U+2518 key: C=+X; corner up and left
190 BE   U+2598 key: C=+V; top left block
191 BF   U+259A key: C=+B; top left and bottom right blocks
 
Block 6, Extended Graphics (Primary)
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
192 C0   U+2500 key: Shift+*; Horizontal bar at Y 5/8 (VIC-II/TED centered thick bar)
193 C1   U+2660 key: Shift+A; Spade suit
194 C2 ?   U+?? key: Shift+B; Vertical bar at X 4/8 (VIC-II/TED centered thick bar)
195 C3 ?   U+?? key: Shift+C; Horizontal bar at Y 4/8 (VIC-II/TED centered thick bar)
196 C4 ?   U+?? key: Shift+D; Horizontal bar at Y 3/8
197 C5 ?   U+?? key: Shift+E; Horizontal bar at Y 2/8
198 C6 ?   U+?? key: Shift+F; Horizontal bar at Y 6/8
199 C7 ?   U+?? key: Shift+G; Vertical bar at X 3/8
200 C8 ?   U+?? key: Shift+H; Vertical bar at X 6/8
201 C9   U+256E key: Shift+I; Arc bottom to left
202 CA   U+2570 key: Shift+J; Arc top to right
203 CB   U+256F key: Shift+K; Arc top to left
204 CC   U+2599 key: Shift+L; Bottom left corner, similar to "L"
205 CD   U+2572 key: Shift+M; Diaganol top left to bottom right
206 CE   U+2571 key: Shift+N; Diaganol bottom left to top right
207 CF
  U+259B key: Shift+O; Top left corner, similar to "Γ"
208 D0   U+259C key: Shift+P; Top right corner, similar to "7")
209 D1 ∙ (or •)   U+2219 or U+2022
key: Shift+Q; Solid circle/bullet
210 D2 ?   U+?? key: Shift+R; Horizontal bar at Y 7/8
211 D3   U+2665 key: Shift+S; Heart suit
212 D4 ?   U+?? key: Shift+T; Horizontal bar at X 2/8
213 D5   U+256D key: Shift+U; Arc bottom to right
214 D6   U+2573 key: Shift+V; Diaganol cross, similar to "X"
215 D7   U+2218 key: Shift+W; Hollow circle/bullet
216 D8   U+2663 key: Shift+X; Spade suit
217 D9 ?   U+?? key: Shift+Y; Vertical bar at X 7/8
218 DA   U+2666 key: Shift+Z; Diamond suit
219 DB   U+253C key: Shift++; Cross, similar to "+"
220 DC (left half)   U+25A6 (left half) key: C=+-; Diaganol cross-hatch (left half)
221 DD 124 | U+2502 key: Shift+-; Vertical bar at X 5/8 (VIC-II/TED centered thick bar)
222 DE π   U+03C0 key: C=+^ or Shift+^; lower-case pi
223 DF   U+25E5 key: C=+*; Upper right triangle
 
Block 7, Common Graphics (Alternate)
Code Glyph  ASCII Unicode Note(s)
Dec. Hex
224 E0   32 SP U+00A0 key: Shift+Spacebar; non-breaking space
225 E1   U+258C key: C=+K; right half block
226 E2   U+2584 key: C=+I; bottom half block
227 E3   U+2594 key: C=+T; top 1/8 block
228 E4   U+2581 key: C=+@; bottom 1/8 block
229 E5   U+258F key: C=+G; left 1/8 block (2/8 block on VIC-II and TED)
230 E6   U+25A9 key: C=++; diaganol cross-hatch
231 E7   U+2595 key: C=+M; right 1/8 block (2/8 block on VIC-II and TED)
232 E8 ?   U+??? key: C=+£; bottom half cross-hatch
233 E9   U+25E4 key: Shift+£; upper left triangle
234 EA   reverse U+258A key: C=+N; right 2/8 block (reverse Unicode left 6/8)
235 EB   U+251C key: C=+Q; East-pointing "T"
236 EC   U+2597 key: C=+D; bottom right block
237 ED   U+2514 key: C=+Z; corner up and right
238 EE   U+2510 key: C=+S; corner down and left
239 EF   U+2582 key: C=+P; bottom 2/8 block
240 F0   U+250C key: C=+A; corner down and right
241 F1   U+2534 key: C=+E; North-pointing "T"
242 F2   U+252C key: C=+R; South-pointing "T"
243 F3   U+2524 key: C=+W; West-pointing "T"
244 F4   U+258E key: C=+H; left 2/8 block
245 F5   U+258D key: C=+J; left 3/8 block
246 F6   reverse U+258B key: C=+L; right 3/8 block (reverse Unicode left 5/8)
247 F7   reverse U+2586 key: C=+Y; top 2/8 block (reverse Unicode bottom 6/8)
248 F8   reverse U+2585 key: C=+Y; top 3/8 block (reverse Unicode bottom 5/8)
249 F9   U+2583 key: C=+O; bottom 3/8 block
250 FA
  U+259F key: Shift+@; Bottom right corner, similar to "L" mirror-X
251 FB   U+2596 key: C=+F; bottom left block
252 FC   U+259D key: C=+C; top right block
253 FD   U+2518 key: C=+X; corner up and left
254 FE   U+2598 key: C=+V; top left block
255 FF π (not ▚)   U+03C0 key: C=+^ or Shift+^; lower-case pi (NOT pair of blocks; see code 191)
 

© H2Obsession, 2014, 2015, 2016
Comments