PETSCII

PETSCII (PET Standard Code of Information Interchange), also known as CBM ASCII, is the character set used in Commodore Business Machines' 8-bit home computers.

[4] The VIC-20 used the same pixel-for-pixel font as the PET, although the characters appeared wider due to the VIC's 22-column screen.

The Commodore 64, however, used a slightly re-designed, heavy upper-case font, essentially a thicker version of the PET's, in order to avoid color artifacts created by the machine's higher resolution screen.

In all versions except the original Commodore PET, it also has a British pound sign ⟨£⟩ instead of the backslash ⟨\⟩ at 0x5C.

Other characters added in ASCII-1967 (lowercase letters, the grave accent, curly braces, vertical bar, and tilde) do not exist in PETSCII.

Codes 0xA0–0xDF are allotted to CBM-specific block graphics characters—horizontal and vertical lines, hatches, shades, triangles, circles and card suits.

The shift can be done by POKEing location 59468 with the value 14 to select the alternative set or 12 to revert to standard.

The control codes appeared in program listings as reverse-video graphic characters, although some computer magazines, in their efforts to provide more clearly readable listings, pretty-printed the codes using their actual names in curly braces, like the above examples.

Additionally, in Commodore PET 2001's shifted character set, uppercase and lowercase letters are swapped relative to other systems'.

For storing binary data in Commodore BASIC, it appears that two- or three-digit line numbers are typically the best choice.

PETSCII Chart as displayed on the Commodore 64 in shifted and unshifted modes. (Not shown are control codes, as well as characters in the 0xC0–0xFF range, which are the standard uppercase keycodes returned from the keyboard, and which are duplicated to the range 0x60–0x7F.)
PET 2001 keyboard layout, illustrating PETSCII graphics characters