NEWS, EDITORIALS, REFERENCE

Subscribe to C64OS.com with your favorite RSS Reader
August 4, 2017 #38 Reference

Commodore 64 PETSCII Codes

Post Archive Icon

Here is the second most frequent table that I find myself using, after screen codes: The PETSCII table.

UPDATE: December 10, 2021

Originally these were laid out in horizontal rows as Block 1, 3, 5, 7, and then on the next row, Block 2, 4, 6, 8. I did it this way because I copied the layout found in the Complete Commodore Innerspace Anthology. However, upon working with PETSCII for a few years, I've realized that it makes a lot more sense to show the low 4 blocks together, and the upper 4 blocks together.

It believe this new layout makes it easier to see the relationship between the upper and lower blocks. Merry Christmas!

Block 1 Block 2 Block 3 Block 4
DEC HEX PETSCII DEC HEX PETSCII DEC HEX PETSCII DEC HEX PETSCII
0 $00   32 $20 space 64 $40 @ 96 $60  
1 $01   33 $21 ! 65 $41 a 97 $61  
2 $02   34 $22 " 66 $42 b 98 $62  
3 $03 stop 35 $23 # 67 $43 c 99 $63  
4 $04   36 $24 $ 68 $44 d 100 $64  
5 $05 white 37 $25 % 69 $45 e 101 $65  
6 $06   38 $26 & 70 $46 f 102 $66  
7 $07   39 $27 ' 71 $47 g 103 $67  
8 $08 lock 40 $28 ( 72 $48 h 104 $68  
9 $09 unlock 41 $29 ) 73 $49 i 105 $69  
10 $0A   42 $2A * 74 $4A j 106 $6A  
11 $0B   43 $2B + 75 $4B k 107 $6B  
12 $0C   44 $2C , 76 $4C l 108 $6C  
13 $0D car ret 45 $2D - 77 $4D m 109 $6D  
14 $0E text 46 $2E . 78 $4E n 110 $6E  
15 $0F   47 $2F / 79 $4F o 111 $6F  
16 $10   48 $30 0 80 $50 p 112 $70  
17 $11 cur down 49 $31 1 81 $51 q 113 $71  
18 $12 reverse 50 $32 2 82 $52 r 114 $72  
19 $13 cur home 51 $33 3 83 $53 s 115 $73  
20 $14 delete 52 $34 4 84 $54 t 116 $74  
21 $15   53 $35 5 85 $55 u 117 $75  
22 $16   54 $36 6 86 $56 v 118 $76  
23 $17   55 $37 7 87 $57 w 119 $77  
24 $18   56 $38 8 88 $58 x 120 $78  
25 $19   57 $39 9 89 $59 y 121 $79  
26 $1A   58 $3A : 90 $5A z 122 $7A  
27 $1B   59 $3B ; 91 $5B [ 123 $7B  
28 $1C red 60 $3C < 92 $5C £ 124 $7C  
29 $1D cur right 61 $3D = 93 $5D ] 125 $7D  
30 $1E green 62 $3E > 94 $5E ↑ 126 $7E  
31 $1F blue 63 $3F ? 95 $5F ← 127 $7F  

Block 5 Block 6 Block 7 Block 8
DEC HEX PETSCII DEC HEX PETSCII DEC HEX PETSCII DEC HEX PETSCII
128 $80   160 $A0 Shift-Space 192 $C0 224 $E0  
129 $81 orange 161 $A1 193 $C1 A 225 $E1  
130 $82   162 $A2 194 $C2 B 226 $E2  
131 $83 load & run 163 $A3 195 $C3 C 227 $E3  
132 $84   164 $A4 196 $C4 D 228 $E4  
133 $85 F1 165 $A5 197 $C5 E 229 $E5  
134 $86 F3 166 $A6 198 $C6 F 230 $E6  
135 $87 F5 167 $A7 199 $C7 G 231 $E7  
136 $88 F7 168 $A8 200 $C8 H 232 $E8  
137 $89 F2 169 $A9 201 $C9 I 233 $E9  
138 $8A F4 170 $AA 202 $CA J 234 $EA  
139 $8B F6 171 $AB 203 $CB K 235 $EB  
140 $8C F8 172 $AC 204 $CC L 236 $EC  
141 $8D car ret 173 $AD 205 $CD M 237 $ED  
142 $8E graphics 174 $AE 206 $CE N 238 $EE  
143 $8F   175 $AF 207 $CF O 239 $EF  
144 $90 black 176 $B0 208 $D0 P 240 $F0  
145 $91 cur up 177 $B1 209 $D1 Q 241 $F1  
146 $92 rvs off 178 $B2 210 $D2 R 242 $F2  
147 $93 clear 179 $B3 211 $D3 S 243 $F3  
148 $94 insert 180 $B4 212 $D4 T 244 $F4  
149 $95 brown 181 $B5 213 $D5 U 245 $F5  
150 $96 lt. red 182 $B6 214 $D6 V 246 $F6  
151 $97 dk. grey 183 $B7 215 $D7 W 247 $F7  
152 $98 md. grey 184 $B8 216 $D8 X 248 $F8  
153 $99 lt. green 185 $B9 217 $D9 Y 249 $F9  
154 $9A lt. blue 186 $BA 218 $DA Z 250 $FA  
155 $9B lt. grey 187 $BB 219 $DB 251 $FB  
156 $9C purple 188 $BC 220 $DC 252 $FC  
157 $9D cur left 189 $BD 221 $DD 253 $FD  
158 $9E yellow 190 $BE 222 $DE 254 $FE  
159 $9F cyan 191 $BF 223 $DF 255 $FF  

UPDATE: January 22, 2018

The "Discussion" section below, replaces the original "notes" section.

Discussion

I have updated this PETSCII table to agree with the VIC-20/C64 SuperChart. So, please read the end discussion of that post for a more complete understanding of why the chart above appears as it does, and why it differs from the original source: http://sta.c64.org/cbm64pet.html.

The table above has been sub-divided into 8 blocks. This makes it easy to reference, because PETSCII is fundamentally divided into functional blocks of 32 characters each.

Blocks 1 and 5 ($00–$1F, $80–9F) are control codes. Printing them will cause a change in the screen layout or behavior, but no actually character will be displayed.

Blocks 4 and 8 ($60–$7F, $E0–$FF) are not used. If they are printed, the KERNAL will interpret them as mirrors of blocks 7 and 6 ($C0–$DF, $A0–BF) respectively.

UPDATE: April 16, 2018

I found this PDF description and overview of PETSCII on aivosto.com. I thought it might be of interest to anyone interested in PETSCII in more detail. I haven't looked over the document thoroughly, and I'm not responsible for any errors it may contain.

Commodore PETSCII character sets