# NEWS, EDITORIALS, REFERENCE

*Programming Reference*

## Commodore 64 PETSCII Codes

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

Block 1 | Block 3 | Block 5 | Block 7 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|

DEC | HEX | PETSCII | DEC | HEX | PETSCII | DEC | HEX | PETSCII | DEC | HEX | PETSCII |

0 | $00 | 64 | $40 | @ | 128 | $80 | 192 | $C0 | |||

1 | $01 | 65 | $41 | a | 129 | $81 | orange | 193 | $C1 | A | |

2 | $02 | 66 | $42 | b | 130 | $82 | 194 | $C2 | B | ||

3 | $03 | stop | 67 | $43 | c | 131 | $83 | load & run | 195 | $C3 | C |

4 | $04 | 68 | $44 | d | 132 | $84 | 196 | $C4 | D | ||

5 | $05 | white | 69 | $45 | e | 133 | $85 | F1 | 197 | $C5 | E |

6 | $06 | 70 | $46 | f | 134 | $86 | F3 | 198 | $C6 | F | |

7 | $07 | 71 | $47 | g | 135 | $87 | F5 | 199 | $C7 | G | |

8 | $08 | lock | 72 | $48 | h | 136 | $88 | F7 | 200 | $C8 | H |

9 | $09 | unlock | 73 | $49 | i | 137 | $89 | F2 | 201 | $C9 | I |

10 | $0A | 74 | $4A | j | 138 | $8A | F4 | 202 | $CA | J | |

11 | $0B | 75 | $4B | k | 139 | $8B | F6 | 203 | $CB | K | |

12 | $0C | 76 | $4C | l | 140 | $8C | F8 | 204 | $CC | L | |

13 | $0D | car ret | 77 | $4D | m | 141 | $8D | car ret | 205 | $CD | M |

14 | $0E | text | 78 | $4E | n | 142 | $8E | graphics | 206 | $CE | N |

15 | $0F | 79 | $4F | o | 143 | $8F | 207 | $CF | O | ||

16 | $10 | 80 | $50 | p | 144 | $90 | black | 208 | $D0 | P | |

17 | $11 | cur down | 81 | $51 | q | 145 | $91 | cur up | 209 | $D1 | Q |

18 | $12 | reverse | 82 | $52 | r | 146 | $92 | rvs off | 210 | $D2 | R |

19 | $13 | cur home | 83 | $53 | s | 147 | $93 | clear | 211 | $D3 | S |

20 | $14 | delete | 84 | $54 | t | 148 | $94 | insert | 212 | $D4 | T |

21 | $15 | 85 | $55 | u | 149 | $95 | brown | 213 | $D5 | U | |

22 | $16 | 86 | $56 | v | 150 | $96 | lt. red | 214 | $D6 | V | |

23 | $17 | 87 | $57 | w | 151 | $97 | dk. grey | 215 | $D7 | W | |

24 | $18 | 88 | $58 | x | 152 | $98 | md. grey | 216 | $D8 | X | |

25 | $19 | 89 | $59 | y | 153 | $99 | lt. green | 217 | $D9 | Y | |

26 | $1A | 90 | $5A | z | 154 | $9A | lt. blue | 218 | $DA | Z | |

27 | $1B | 91 | $5B | [ | 155 | $9B | lt. grey | 219 | $DB | ||

28 | $1C | red | 92 | $5C | £ | 156 | $9C | purple | 220 | $DC | |

29 | $1D | cur right | 93 | $5D | ] | 157 | $9D | cur left | 221 | $DD | |

30 | $1E | green | 94 | $5E | ↑ | 158 | $9E | yellow | 222 | $DE | |

31 | $1F | blue | 95 | $5F | ← | 159 | $9F | cyan | 223 | $DF | |

Block 2 | Block 4 | Block 6 | Block 8 | ||||||||

DEC | HEX | PETSCII | DEC | HEX | PETSCII | DEC | HEX | PETSCII | DEC | HEX | PETSCII |

32 | $20 | space | 96 | $60 | 160 | $A0 | 224 | $E0 | |||

33 | $21 | ! | 97 | $61 | 161 | $A1 | 225 | $E1 | |||

34 | $22 | " | 98 | $62 | 162 | $A2 | 226 | $E2 | |||

35 | $23 | # | 99 | $63 | 163 | $A3 | 227 | $E3 | |||

36 | $24 | $ | 100 | $64 | 164 | $A4 | 228 | $E4 | |||

37 | $25 | % | 101 | $65 | 165 | $A5 | 229 | $E5 | |||

38 | $26 | & | 102 | $66 | 166 | $A6 | 230 | $E6 | |||

39 | $27 | ' | 103 | $67 | 167 | $A7 | 231 | $E7 | |||

40 | $28 | ( | 104 | $68 | 168 | $A8 | 232 | $E8 | |||

41 | $29 | ) | 105 | $69 | 169 | $A9 | 233 | $E9 | |||

42 | $2A | * | 106 | $6A | 170 | $AA | 234 | $EA | |||

43 | $2B | + | 107 | $6B | 171 | $AB | 235 | $EB | |||

44 | $2C | , | 108 | $6C | 172 | $AC | 236 | $EC | |||

45 | $2D | - | 109 | $6D | 173 | $AD | 237 | $ED | |||

46 | $2E | . | 110 | $6E | 174 | $AE | 238 | $EE | |||

47 | $2F | / | 111 | $6F | 175 | $AF | 239 | $EF | |||

48 | $30 | 0 | 112 | $70 | 176 | $B0 | 240 | $F0 | |||

49 | $31 | 1 | 113 | $71 | 177 | $B1 | 241 | $F1 | |||

50 | $32 | 2 | 114 | $72 | 178 | $B2 | 242 | $F2 | |||

51 | $33 | 3 | 115 | $73 | 179 | $B3 | 243 | $F3 | |||

52 | $34 | 4 | 116 | $74 | 180 | $B4 | 244 | $F4 | |||

53 | $35 | 5 | 117 | $75 | 181 | $B5 | 245 | $F5 | |||

54 | $36 | 6 | 118 | $76 | 182 | $B6 | 246 | $F6 | |||

55 | $37 | 7 | 119 | $77 | 183 | $B7 | 247 | $F7 | |||

56 | $38 | 8 | 120 | $78 | 184 | $B8 | 248 | $F8 | |||

57 | $39 | 9 | 121 | $79 | 185 | $B9 | 249 | $F9 | |||

58 | $3A | : | 122 | $7A | 186 | $BA | 250 | $FA | |||

59 | $3B | ; | 123 | $7B | 187 | $BB | 251 | $FB | |||

60 | $3C | < | 124 | $7C | 188 | $BC | 252 | $FC | |||

61 | $3D | = | 125 | $7D | 189 | $BD | 253 | $FD | |||

62 | $3E | > | 126 | $7E | 190 | $BE | 254 | $FE | |||

63 | $3F | ? | 127 | $7F | 191 | $BF | 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.