Commodore PETSCII (Revealed)

It’s hard to believe, but there is some method to the madness, which is the organization of the Commodore flavor of the ASCII character set. At least, when considering the PET 2001, the very machine this character set was designed for.

Or, a shameless plug for yet another blog post – however, I do honestly believe that there may be some broader interest in this :slight_smile: :

4 Likes

As the only exeption to this, where ASCII has the caret and the underscore at 0x5E and 0x5F , PETSCII has — still recognizable — an up-arrow and a left-arrow, respectively. (Apparently, since BACKSPACE became delete-to-the-left with common on-screen editors, the original ASCII glyphs weren’t found of much use without overprint capabilities…)

Actually, what Commodore has are the original ASCII characters, from ASCII-1963. The 1965 revision replaced and with ^ and _. (There were a few other characters changed as well; you can see a table summarizing this at the bottom of my ASCII chart and the Wikpedia ASCII page has more details on the history of the standard.)

It’s not clear to my why Commodore, in 1976, went with ASCII-1963 rather than ASCII-1967. Maybe they just had only old reference books lying around?

A few years ago, on pagetable.com, Michael Steil speculated on why PETSCII has upper case and lower case reversed, though I think the comment on that post from Rhialto makes a more plausible case. I’ve also made a few notes on PETSCII for myself, with some references.

3 Likes

Originally, Smalltalk used the for assignment (i.e. a ← a + 1), but when things were converted over, it, indeed, turned in to a _ a + 1.

1 Like

Thanks – I included this in an update. (I totally forgot to compare these with the intermediate standards and proposals.) However, I can see why ASCII went for the caret and the underscore and why the older standard makes sense with on-screen editors without overprint.

I suppose, the main reason was that a 7-bit range just fitted into a single K of character ROM. (Cheaper ROM, less address lines, cost effective logic.) Lower-case characters were still somewhat unheard of for smaller systems at the time and the lower case set was probably added in a later step (probably with an eye on business reports), in a way, which didn’t require any modifications of the hardware. Graphics characters, on the other hand, were somewhat essential – all the of the “trinity of 1977” had them. (No bitmap graphics and maybe just a handful of graphics characters, means no games.) If you had to chose for a small system like the PET, the options were for what Commodore did. (But this is just my personal impressions.)

The Apple II did not: it had only 6 bits worth of character codes (64 in total, the ASCII punctuation/number sticks and ASCII upper-case sticks). These could be displayed as normal, inverse or flashing characters. The details are given on pp. 14-16 of the Apple II Reference Manual.

Presumably graphics characters weren’t felt to be necessary because the II had both 16-colour 40×48 low-resolution graphics and 6-colour 256280×192 high-resolution graphics. (In the DOS Tool Kit Apple included a set of routines called the HRCG—High-Resolution Character Generator—that allowed you to define custom character sets and display them on the high-resolution graphics screen.)

Later versions of the Apple II series (IIe onwards) added lower-case and MouseText graphical characters, but that didn’t include “block graphics” characters, just icons.

Yes – no need for character graphics.

The older ASCII standard was used in several popular teletypes and at least Xerox and DEC were still using that in the early 1980s.

It was actually 280x192 (280 = 40x7) pixels. The original Apple II had black, white and two colors (only 7 bits per byte were used) and the Apple II+ upgraded that to black, white, two colors or two different colors (using the 8th bit to select between the latter two cases), which counted as 6 colors total.

Oops, yes! Thanks for the correction.

I suppose I’m just more used to remembering and typing round numbers like 256 than quite odd ones like 280. :-)

256x192 has the correct 4:3 ratio of old TV screens and so was widely adopted. The Apple II had distorted graphics, as did the Lisa. The Macintosh finally addressed the problem.

Right. But I was referring to the fact that 256 is a perfectly round number and 192 a close ratio of one, and thus pretty round as well. You could get the same 4:3 screen ratio with 400x300 pixels, but those are very odd numbers indeed.

(For those out there who don’t automatically think in powers of two in their heads, 256 in decimal is $100 in hexadecmal, and 192 is $C0, exactly 3/4 of $100. Whereas 400 is $190, which is 25/32 of $200, and 300 is $12C, which ratio to anything I’m not even going to bother to calculate.)

Old thread, but I’m just catching up - the actual pixel aspect ratio of various computers with 256x192 resolution was actually the same as the pixel aspect ratio of the Apple ][ (280x192) and the Atari 8-bits (320x192). The Apple ][ and Atari 8-bits merely used more width of each raster line. Since extremely few monitors of the time had a width adjustment, this meant the Atari 8-bits were more likely to have screens that simply overscanned into the CRT edges.

The IBM CGA color graphics had similar timings to the Atari 8-bits (320x200), but they were more likely than the Atari computers to be attached to a monitor with vertical size adjustment. That wouldn’t help with width adjustment, but it did mean there was some choice about pixel aspect ratio. Usually, people would expand the screen vertically so it filled out a roughly 4:3 screen space - resulting in rather tall pixels. You can see this reflected in the circular shapes drawn in CGA graphics games of the era.

But for the others (TRS-80 CoCo, TI-99, Apple ][, Atari 8-bit), most would be connected to a TV with no v-size adjustment. Thus, the pixel aspect ratio would be strictly determined by signal timing. In this case, all of these computers output pixels that were half a chroma period long (NTSC). As such, these pixels would have an aspect ratio of about 8:9 - a bit narrow, but not by a whole lot. One weird legacy of this would be how some Amiga dot matrix printers had a weird aspect ratio of 80dpi horizontally and 72dpi vertically. By that time, the Macintosh had popularized the WYSIWYG concept, but the Amiga didn’t have square pixels, so …