PETSCII (''PET Standard Code of Information Interchange''), also known as CBM ASCII, is the character set used in
Commodore Business Machines (CBM)'s 8-bit
home computers, starting with the
PET
A pet, or companion animal, is an animal kept primarily for a person's company or entertainment rather than as a working animal, livestock, or a laboratory animal. Popular pets are often considered to have attractive appearances, intelligence ...
from 1977 and including the
C16,
C64,
C116,
C128,
CBM-II
The Commodore CBM-II series is a short-lived range of 8-bit personal computers from Commodore Business Machines (CBM), released in 1982 and intended as a follow-on to the Commodore PET series.
Technical description
The CBM-II has two incarnat ...
,
Plus/4, and
VIC-20
The VIC-20 (known as the VC-20 in Germany and the VIC-1001 in Japan) is an 8-bit home computer that was sold by Commodore Business Machines. The VIC-20 was announced in 1980, roughly three years after Commodore's first personal computer, the ...
.
History
The character set was largely designed by
Leonard Tramiel
Leonard or ''Leo'' is a common English masculine given name and a surname.
The given name and surname originate from the Old High German ''Leonhard'' containing the prefix ''levon'' ("lion") from the Greek Λέων ("lion") through the Latin ''Le ...
(the son of Commodore CEO
Jack Tramiel
Jack Tramiel ( ; born Idek Trzmiel; December 13, 1928 – April 8, 2012) was an American businessman and Holocaust survivor, best known for founding Commodore International. The Commodore PET, VIC-20 and Commodore 64 are some home compu ...
) and PET designer
Chuck Peddle
Charles Ingerham Peddle (November 25, 1937 – December 15, 2019) was an American electrical engineer best known as the main designer of the MOS Technology 6502 microprocessor, the single-board computer, and its successor, the Commodore PET per ...
. The graphic characters of PETSCII were one of the extensions Commodore specified for
Commodore BASIC
Commodore BASIC, also known as PET BASIC or CBM-BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the PET of 1977 to the C128 of 1985.
The core is based on 6502 ...
when laying out desired changes to Microsoft's existing
6502
The MOS Technology 6502 (typically pronounced "sixty-five-oh-two" or "six-five-oh-two") William Mensch and the moderator both pronounce the 6502 microprocessor as ''"sixty-five-oh-two"''. is an 8-bit microprocessor that was designed by a small te ...
BASIC
BASIC (Beginners' All-purpose Symbolic Instruction Code) is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College ...
to Microsoft's
Ric Weiland in 1977.
[A Conversation with Chuck Peddle, Bil Herd, Jeri Ellsworth - part 3 (2009 videoconference, 06:30)]
The VIC-20 used the same pixel-for-pixel
font
In movable type, metal typesetting, a font is a particular #Characteristics, size, weight and style of a typeface. Each font is a matched set of type, with a piece (a "Sort (typesetting), sort") for each glyph. A typeface consists of a range of ...
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. The C64's lowercase characters are identical to the lowercase characters in the
Atari 800
The Atari 8-bit family is a series of 8-bit home computers introduced by Atari, Inc. in 1979 as the Atari 400 and Atari 800. The series was successively upgraded to Atari 1200XL , Atari 600XL, Atari 800XL, Atari 65XE, Atari 130XE, Atari 800XE ...
's system font (released several years earlier).
Peddle claims the inclusion of card suit symbols was spurred by the demand that it should be easy to write card games on the PET (as part of the specification list he received).
Specifications
PETSCII is based on the
1963
Events January
* January 1 – Bogle–Chandler case: Commonwealth Scientific and Industrial Research Organisation scientist Dr. Gilbert Bogle and Mrs. Margaret Chandler are found dead (presumed poisoned), in bushland near the Lane Co ...
version of ASCII (rather than the
1967
Events
January
* January 1 – Canada begins a year-long celebration of the 100th anniversary of Canadian Confederation, Confederation, featuring the Expo 67 World's Fair.
* January 5
** Spain and Romania sign an agreement in Paris, establ ...
version, which most if not all other computer character sets based on ASCII use). Assuming the graphics mode is ''unshifted'', PETSCII has only uppercase letters in its powerup state, an up-arrow ( ↑ ) instead of a
caret
Caret is the name used familiarly for the character , provided on most QWERTY keyboards by typing . The symbol has a variety of uses in programming and mathematics. The name "caret" arose from its visual similarity to the original proofreade ...
( ^ ) in position
$5E and a left-arrow ( ← ) instead of an
underscore
An underscore, ; also called an underline, low line, or low dash; is a line drawn under a segment of text. In proofreading, underscoring is a convention that says "set this text in italic type", traditionally used on manuscript or typescript as ...
( _ ) in position $5F, these two variants are common in ASCII-1963. Also, in the VIC-20 and C64 version, the backslash ( \ ) in position $5C is occupied by a British pound sign ( £ ) (preceding the usage of the same ASCII code by the
Japanese
Japanese may refer to:
* Something from or related to Japan, an island country in East Asia
* Japanese language, spoken mainly in Japan
* Japanese people, the ethnic group that identifies with Japan through ancestry or culture
** Japanese diaspor ...
and Korean versions of
ISO 646
ISO/IEC 646 is a set of ISO/ IEC standards, described as ''Information technology — ISO 7-bit coded character set for information interchange'' and developed in cooperation with ASCII at least since 1964. Since its first edition in ...
for their respective currency symbols). In ''unshifted mode'', codes $60–$7F and $A0–$FF are allotted to CBM-specific block graphics characters (horizontal and vertical lines, hatches, shades, triangles, circles and
card suits). Ranges $00–$1F and $80–$9F have control codes.
The
Commodore PET
The Commodore PET is a line of personal computers produced starting in 1977 by Commodore International. A single all-in-one case combines a MOS Technology 6502 microprocessor, Commodore BASIC in read-only memory, keyboard, monochrome monitor, ...
's lack of a programmable
bitmap
In computing, a bitmap is a mapping from some domain (for example, a range of integers) to bits. It is also called a bit array or bitmap index.
As a noun, the term "bitmap" is very often used to refer to a particular bitmapping application: th ...
-mode for
computer graphics
Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great deal ...
, as well as it having no redefinable character set capability, may be one of the reasons PETSCII was developed; by creatively using the well-thought-out block graphics, a higher degree of sophistication in screen graphics is attainable than by using plain ASCII's letter/digit/punctuation characters. In addition to the relatively diverse set of geometrical shapes that can thus be produced, PETSCII allows for several
grayscale
In digital photography, computer-generated imagery, and colorimetry, a grayscale image is one in which the value of each pixel is a single sample representing only an ''amount'' of light; that is, it carries only intensity information. Graysc ...
levels by its provision of differently hatched
checkerboard
A checkerboard (American English) or chequerboard (British English; see spelling differences) is a board of checkered pattern on which checkers (also known as English draughts) is played. Most commonly, it consists of 64 squares (8×8) of altern ...
squares/half-squares. Finally, the reverse-video mode (see below) is used to complete the range of graphics characters, in that it provides mirrored half-square blocks.
PETSCII also has a ''text mode'', in which lowercase letters occupy the range $41–$5A, and uppercase letters occupy the range $C1–$DA. The mode is toggled by holding one of the SHIFT keys and then pressing and releasing the ''Commodore'' key. Regardless of whether the chip has undergone this graphic "shift", there are block graphic characters in the range of $E0-FF. This serves to distinguish PETSCII from those kinds of ASCII that go back no farther than ASCII-1967, so any text transfer between an 8-bit Commodore machine and one that uses 1967-derived ASCII would result in text where uppercase letters appear to be lowercase, and lowercase letters uppercase. There is no easy
Boolean operation to change these cases to the proper case. Thus, as with other computers based on non-standard-ASCII character sets, software conversion is needed when exchanging text files and/or telecommunicating with standard ASCII systems. The other ranges are unchanged in shifted mode; this means that the other characters added in ASCII-1967 besides lowercase lettersi.e. the grave accent, curly braces, vertical bar, and tildedo not exist in PETSCII.
Included in PETSCII are
cursor and screen control codes, such as
,
,
, and
(the latter two activating/deactivating reverse-video character display). 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, like the above examples. Such names were commonly enclosed in curly braces in the listings. This prevented ambiguity, since, as mentioned, PETSCII had no curly brace characters. The screen control codes were essentially similar to
escape codes
In computer science, an escape sequence is a combination of characters that has a meaning other than the literal characters contained therein; it is marked by one or more preceding (and possibly terminating) characters.
Examples
* In C and man ...
for text based computer terminals.
As indicated above, PETSCII provides for shifting between the power-on default (unshifted) uppercase+graphics character set and the alternative (shifted) lower+uppercase set (where the shifted set contains a subset of the block graphic characters of the unshifted set). The shift between modes is done by
POKEing location 59468 with the value 14 to select the alternative set or 12 to revert to standard. On C64 the sets are alternated by flipping bit 2 of the byte 53272. On some models of PET this can also be achieved via special control code
PRINT CHR$(14)
which adjust the line spacing as well as changing the character set; the POKE method is still available and does not alter the line spacing.
[THE COMMODORE PET COMPUTER / FREQUENTLY ASKED QUESTIONS FILE ]
VERSION 1.7 ( Updated 25 November 2000) BY LARRY ANDERSSON, COMMODORE COLLECTOR AND PET ENTHUSIAST Thus, screen editor state changes, rather than the employment of separate ASCII codes, are used to choose between single-case (all capitals) and dual case. In the VIC-20, C64, and later machines (not including the CBM business computers), color codes supplement the other screen control codes. (The colors of the VIC-20 and C64/128 are listed in the
VIC-II
The VIC-II (Video Interface Chip II), specifically known as the MOS Technology 6567/8562/8564 (NTSC versions), 6569/8565/8566 (PAL), is the microchip tasked with generating Y/C video signals (combined to composite video in the RF modulator) and D ...
article.)
Character set
Not all of the characters encoded by PETSCII are 'graphic' and not all of them have a corresponding
Unicode
Unicode, formally The Unicode Standard,The formal version reference is is an information technology standard for the consistent encoding, representation, and handling of text expressed in most of the world's writing systems. The standard, ...
representation. The following table shows for PETSCII characters the corresponding Unicode character and
code point
In character encoding terminology, a code point, codepoint or code position is a numerical value that maps to a specific character. Code points usually represent a single grapheme—usually a letter, digit, punctuation mark, or whitespace—bu ...
.
Control character
In computing and telecommunication, a control character or non-printing character (NPC) is a code point (a number) in a character set, that does not represent a written symbol. They are used as in-band signaling to cause effects other than the ...
s and other non-printing characters are represented by their names. Where a particular code point encodes both a shifted and unshifted character, both characters are shown, with the unshifted character on the left and the shifted character on the right. Row and column headings indicate the
hexadecimal
In mathematics and computing, the hexadecimal (also base-16 or simply hex) numeral system is a positional numeral system that represents numbers using a radix (base) of 16. Unlike the decimal system representing numbers using 10 symbols, h ...
digit combinations to produce the eight-bit code value; e.g., the letter ''L'' is at code value $4C.
Note that the table below is for the