Skip to content

Commodore PETSCII escape codes ​

Every escape that can be typed in Commodore source, and the PETSCII byte it stores. PETSCII is shared byte-for-byte across the whole Commodore 8-bit line, so this table is the escape reference for the Commodore 64, the VIC-20 and the PET alike. Escapes are recognised in string literals, REM and DATA bodies. Filters can be prefilled with ?q= and ?cat= query parameters.

Colour on a monochrome machine ​

The colour-control escapes ({red}, {cyan}…) drive the colour display on the C64 and VIC-20. On the monochrome PET they store and round-trip identically but have no visible effect.

The lower-case display bank is not yet modelled, so a program that switches to it shows the upper-case/graphics shapes instead.

petcat and VICE aliases ​

Canonical names follow this app's decode. The petcat/VICE aliases — {wht}, {rvof}, decimal {147}, {CBM-x}/{SHIFT-x} — are accepted on input, so archived petcat listings paste straight in. They are accepted, never produced: a listing exported from here uses the canonical name.

In a {CBM-x}/{SHIFT-x} name, x is whatever the keycap says, so the symbol keys work as well as the letters — {SHIFT-*} is the horizontal line and {CBM-+} the chequerboard.

Where a code is spelled several ways in the wild the alternatives are accepted too, spaces and all: reverse video takes {rvon}, {rvson} or {rvs on}, and {rvoff}, {rvof}, {rvsoff} or {rvs off}.

Shifted-letter keyword abbreviations ​

pO for POKE and goS for GOSUB tokenize as they do on the machine and list back in full. The {SHIFT-x} escape spells the shifted letter where the plain capital would be ambiguous.

See also the Commodore BASIC reference and file formats.

Description
{stop}0x03The STOP key code (CHR$ 3).
{white}
also: {wht}
0x05Text colour white (CHR$ 5).
{dishift}0x08Disable SHIFT+C= case switching (CHR$ 8).
{enshift}0x09Enable SHIFT+C= case switching (CHR$ 9).
{cr}0x0DCarriage return (CHR$ 13).
{lower}
also: {swlc}
0x0ESwitch the display to the lower-case / upper-case character set (CHR$ 14).
{down}0x11Cursor down one row (CHR$ 17).
{rvon}
also: {rvson}{rvs on}
0x12Reverse video on: characters print with their foreground and background swapped from here to the end of the line, or until reverse video is turned off (CHR$ 18).
{home}0x13Cursor home - top-left of the screen (CHR$ 19).
{del}0x14Delete the character before the cursor (CHR$ 20).
{red}0x1CText colour red (CHR$ 28).
{right}
also: {rght}
0x1DCursor right one column (CHR$ 29).
{green}
also: {grn}
0x1EText colour green (CHR$ 30).
{blue}
also: {blu}
0x1FText colour blue (CHR$ 31).
{space}parse-only0x20An ordinary space (CHR$ 32), petcat spelling.
{$xx}anyAny raw byte as one or two hex digits - unassigned control codes, the shifted-bank text range $60-$7F, $E0-$FE and the hardware-duplicate glyph codes ($AA, $B4, $C3, $DD, $DE). The lower-case display bank is not yet modelled.
{orange}
also: {orng}
0x81Text colour orange (CHR$ 129).
{f1}0x85Function key f1 (CHR$ 133).
{f3}0x86Function key f3 (CHR$ 134).
{f5}0x87Function key f5 (CHR$ 135).
{f7}0x88Function key f7 (CHR$ 136).
{f2}0x89Function key f2 (CHR$ 137).
{f4}0x8AFunction key f4 (CHR$ 138).
{f6}0x8BFunction key f6 (CHR$ 139).
{f8}0x8CFunction key f8 (CHR$ 140).
{shift-cr}
also: {sret}
0x8DShifted return (CHR$ 141): moves to the next line without executing it.
{upper}
also: {swuc}
0x8ESwitch the display to the upper-case / graphics character set (CHR$ 142).
{black}
also: {blk}
0x90Text colour black (CHR$ 144).
{up}0x91Cursor up one row (CHR$ 145).
{rvoff}
also: {rvof}{rvsoff}{rvs off}
0x92Reverse video off: characters print normally again (CHR$ 146).
{clr}0x93Clear the screen and home the cursor (CHR$ 147).
{inst}0x94Insert a space at the cursor (CHR$ 148).
{brown}
also: {brn}
0x95Text colour brown (CHR$ 149).
{pink}
also: {lred}
0x96Text colour pink / light red (CHR$ 150).
{grey1}
also: {gry1}
0x97Text colour dark grey (CHR$ 151).
{grey2}
also: {gry2}
0x98Text colour medium grey (CHR$ 152).
{lgreen}
also: {lgrn}
0x99Text colour light green (CHR$ 153).
{lblue}
also: {lblu}
0x9AText colour light blue (CHR$ 154).
{grey3}
also: {gry3}
0x9BText colour light grey (CHR$ 155).
{purple}
also: {pur}
0x9CText colour purple (CHR$ 156).
{left}0x9DCursor left one column (CHR$ 157).
{yellow}
also: {yel}
0x9EText colour yellow (CHR$ 158).
{cyan}
also: {cyn}
0x9FText colour cyan (CHR$ 159).
{shift-space}0xA0Shifted space (CHR$ 160): displays as a space but is a distinct code.
{CBM-k}parse-only0xA1Block graphic on the C= face of the K key (▌).
{CBM-i}parse-only0xA2Block graphic on the C= face of the I key (▄).
{CBM-t}parse-only0xA3Block graphic on the C= face of the T key (▔).
{nnn}parse-onlyanyAny raw byte as a decimal code 0-255 (petcat/VICE spelling), e.g. {147} for {clr}.
{CBM-@}parse-only0xA4Block graphic on the C= face of the @ key (▁).
{CBM-g}parse-only0xA5Block graphic on the C= face of the G key (▎).
{CBM-+}parse-only0xA6Block graphic on the C= face of the + key (▒).
{CBM-m}parse-only0xA7Block graphic on the C= face of the M key (▕).
{CBM-£}parse-only0xA8Block graphic on the C= face of the £ key (🮏).
{SHIFT-£}parse-only0xA9Graphic on the SHIFT face of the £ key (◤).
{CBM-n}parse-only0xAABlock graphic on the C= face of the N key (▕). This code is a hardware duplicate glyph, so it decodes back as a raw {$aa} escape.
{CBM-q}parse-only0xABBlock graphic on the C= face of the Q key (├).
{CBM-d}parse-only0xACBlock graphic on the C= face of the D key (▗).
{CBM-z}parse-only0xADBlock graphic on the C= face of the Z key (└).
{CBM-s}parse-only0xAEBlock graphic on the C= face of the S key (┐).
{CBM-p}parse-only0xAFBlock graphic on the C= face of the P key (▂).
{CBM-a}parse-only0xB0Block graphic on the C= face of the A key (┌).
{CBM-e}parse-only0xB1Block graphic on the C= face of the E key (┴).
{CBM-r}parse-only0xB2Block graphic on the C= face of the R key (┬).
{CBM-w}parse-only0xB3Block graphic on the C= face of the W key (┤).
{CBM-h}parse-only0xB4Block graphic on the C= face of the H key (▎). This code is a hardware duplicate glyph, so it decodes back as a raw {$b4} escape.
{CBM-j}parse-only0xB5Block graphic on the C= face of the J key (▍).
{CBM-l}parse-only0xB6Block graphic on the C= face of the L key (🮈).
{CBM-y}parse-only0xB7Block graphic on the C= face of the Y key (🮂).
{CBM-u}parse-only0xB8Block graphic on the C= face of the U key (🮃).
{CBM-o}parse-only0xB9Block graphic on the C= face of the O key (▃).
{SHIFT-@}parse-only0xBAGraphic on the SHIFT face of the @ key (⌟).
{CBM-f}parse-only0xBBBlock graphic on the C= face of the F key (▖).
{CBM-c}parse-only0xBCBlock graphic on the C= face of the C key (▝).
{CBM-x}parse-only0xBDBlock graphic on the C= face of the X key (┘).
{CBM-v}parse-only0xBEBlock graphic on the C= face of the V key (▘).
{CBM-b}parse-only0xBFBlock graphic on the C= face of the B key (▚).
{SHIFT-*}parse-only0xC0Graphic on the SHIFT face of the * key (─).
{SHIFT-a}parse-only0xC1Graphic on the SHIFT face of the A key (♠).
{SHIFT-b}parse-only0xC2Graphic on the SHIFT face of the B key (│).
{SHIFT-c}parse-only0xC3Graphic on the SHIFT face of the C key (─). This code is a hardware duplicate glyph, so it decodes back as a raw {$c3} escape.
{SHIFT-d}parse-only0xC4Graphic on the SHIFT face of the D key (🭷).
{SHIFT-e}parse-only0xC5Graphic on the SHIFT face of the E key (🭶).
{SHIFT-f}parse-only0xC6Graphic on the SHIFT face of the F key (🭹).
{SHIFT-g}parse-only0xC7Graphic on the SHIFT face of the G key (🭱).
{SHIFT-h}parse-only0xC8Graphic on the SHIFT face of the H key (🭳).
{SHIFT-i}parse-only0xC9Graphic on the SHIFT face of the I key (╮).
{SHIFT-j}parse-only0xCAGraphic on the SHIFT face of the J key (╰).
{SHIFT-k}parse-only0xCBGraphic on the SHIFT face of the K key (╯).
{SHIFT-l}parse-only0xCCGraphic on the SHIFT face of the L key (⌞).
{SHIFT-m}parse-only0xCDGraphic on the SHIFT face of the M key (╲).
{SHIFT-n}parse-only0xCEGraphic on the SHIFT face of the N key (╱).
{SHIFT-o}parse-only0xCFGraphic on the SHIFT face of the O key (⌜).
{SHIFT-p}parse-only0xD0Graphic on the SHIFT face of the P key (⌝).
{SHIFT-q}parse-only0xD1Graphic on the SHIFT face of the Q key (●).
{SHIFT-r}parse-only0xD2Graphic on the SHIFT face of the R key (_).
{SHIFT-s}parse-only0xD3Graphic on the SHIFT face of the S key (♥).
{SHIFT-t}parse-only0xD4Graphic on the SHIFT face of the T key (🭰).
{SHIFT-u}parse-only0xD5Graphic on the SHIFT face of the U key (╭).
{SHIFT-v}parse-only0xD6Graphic on the SHIFT face of the V key (╳).
{SHIFT-w}parse-only0xD7Graphic on the SHIFT face of the W key (○).
{SHIFT-x}parse-only0xD8Graphic on the SHIFT face of the X key (♣).
{SHIFT-y}parse-only0xD9Graphic on the SHIFT face of the Y key (🭴).
{SHIFT-z}parse-only0xDAGraphic on the SHIFT face of the Z key (♦).
{SHIFT-+}parse-only0xDBGraphic on the SHIFT face of the + key (┼).
{CBM--}parse-only0xDCBlock graphic on the C= face of the - key (🮌).
{SHIFT--}parse-only0xDDGraphic on the SHIFT face of the - key (│). This code is a hardware duplicate glyph, so it decodes back as a raw {$dd} escape.
{CBM-*}parse-only0xDFBlock graphic on the C= face of the * key (◥).
{SHIFT-↑}parse-only0xFFPi (CHR$ 255), on the SHIFT face of the ↑ key (π).

Showing 108 of 108 escape codes

Released under GNU GPL v3.0. Some ROM images are third-party copyrighted works, separate to this project, strictly for personal/educational purposes.