The PET

Frank Covitz
DEC 1980

This article describes the pros and cons of the Commodore PET 2001 series personal computer. It is written from the point of view of someone (me) who has used a PET since it was first introduced, and has had some (admittedly limited) experience with other personal computers.

No single machine has everything, so the crux of the matter is to gain an appreciation of how the hardware, firmware, and software interact to your benefit, and to what extent they limit you. These three topics are not strictly separable, but I will use this categorization to keep me from wandering in the following discussion.

HARDWARE

The PET has everything required to operate in a single attractive package - except the cassette recorder. The original PET had a built-in recorder, but a small keyboard. (Although the small keyboard version is no longer being produced, you may be able to get an excellent buy on a used and therefore thoroughly "burned in" small-keyboard model.) The advantage (or disadvantage) of having everything builtin is very much like the corresponding situation with audio equipment, i.e., receiver vs. separate components. For me, it is an advantage since I don't want to contend at the start with a mess of connecting cables (I tend to weave my own tangled web, so who needs additional wires), and I don't have to tie up a TV set for the display. It does, however, mean that the PET is not easily portable.

The black-and-white video image is crisp and stable, and the background is truly black. The display is memorymapped (more about that later) into 25

Frank Cocitz, Deerhill Rd.. Lebanon. NJ 08833

lines of 40 characters. Each character is formed via a character generator ROM within an 8*8 pixel cell (the total screen resolution is therefore 320 horizontal by 200 vertical). In addition to the standard alpha-numerics, you also get a set of graphic symbols, some of which are obviously game-oriented (the card suit symbols, for example). These permit pictorial and graphic images to be formed under program control. I am constantly amazed at the degree of cleverness with which people have put these graphic symbols to use within their programs. A lower-case character set (with descenders) is software selectable, with an attendant loss of most of the graphic symbols.

The (full-sized) keyboard is of good but not superb quality, and the numeric and cursor control keypad are in a conveniently separate cluster. Graphic symbols are visible on the forward vertical side of the keycaps and are accessed in conjunction with the SHIFT key. All alpha-numeric and graphic symbols may be displayed in normal or reverse-field mode at the keyboard or under program control. A single RUN/ STOP key permits you to load in whatever program is next on tape with a single key-stroke, although in general named programs will probably be used within the format of a LOAD command. (A PET operating system, called Basic 4.0, is available which default loads from the disc rather than tape.) The STOP function of this key is somewhat misleading. It is normally effective when the program is running under the control of the Basic operating system, and will get you cleanly out of loops and allow you to abort your programs early. It is essentially useless, however, if you intend to do machine language programming. Under "crash" conditions, you are normally forced to do a power-on reset, which obviously wipes


60

out your program. There is, however, a user-supplied hardware solution, using the RESET and DIAGNOSTIC SENSE wires. It is relatively simple to wire in, but should not be attempted unless you have some hardware abilities, and are willing to invalidate the warranty. On the positive side, the STOP key can be de-activated under program control, which technique can be used to prevent "curious fingers" from stopping your program.

Next in the hardware discussion is the cassette tape storage and retrieval function. Programs and data can be stored and retrieved on cassette tape at the moderate speed of about 80 characters per second. My experience has been good in the sense that I have been able to read in 95+% of PET tapes written by other PET's and have never received complaints when I've sent out tapes.

Actually, two separate tape drives are supported, so that aside from the slow speed and inherently sequential nature of data on tape, it is at least possible to do data-base programming. The tape motor (but not the PLAY and RECORD buttons) is under system control, so the tape will stop when the end of a program or data file is reached. The COMMODORE tape units do not have audio output, so you will not get an audio feedback (which can be quite comforting at times) to let you know all is well, nor do they have tape counters. Thus, it is pretty inconvenient to store several programs or data sets on the same cassette. However, there is nothing magic about the cassette hardware, so that conventional cassette recorders can be adapted to work on the PET, again with some hardware experience.

Next on the hardware agenda is the IEEE-488 bus. This capability permits the PET to service multiple peripheral devices, such as printers, disk drives, plotters, etc.


CREATIVE COMPUTING



Picture
[gallery/gallery_head.htm]



T

PET, cont'd...

As many as 26 external devices can be physically connected in "daisy-chain" style to the PET's IEEE-488 bus, although a maximum of 10 can be active at the same time. The beauty of this way of handling peripheral devices is that there is no programming overhead in operating these devices, i.e., communication to the printer, disk drive, etc. is handled with the same programming techniques. Commands as well as data can be transmitted, so that the external device can have its own "smarts." For example, you can command the disk peripheral to make a disk-to-disk copy with a single command; as soon as the command is sent, the disk system goes on its merry way to complete this several minute task, but the PET is free for any non-disk related task. IEEE-488 devices presently available from Commodore are line printer, dual floppy-disk, telephone modem, and recently, a speech synthesizer. Other IEEE-488 devices are available from a wide variety of manufacturers, but I would definitely advise the reader to specifically verify that they will work with the PET by contacting the manufacturer. On the negative side, IEEE-488 compatible devices tend to be somewhat more expensive than RS-232 devices.

The PET has an 8 bit USER PORT, and two "handshake" lines that are uncommitted, and therefore are completely under control of the user. The physical wires are accessible on an edge connector at the rear of the PET. Software control out of Basic is accomplished by PEEK'ing and POKE'ing to specific address locations. Utilization of the user port requires hardware experience. The lines can in general drive one TTL load, and would therefore need buffering to be used, for example, to turn on a power relay. I have personally used the user port in several ways, for example, to drive a digital-to-analog (DAC) converter to produce music, to communicate data at high speed (about 40,000 bytes per second) between the PET and a KIM or AIM, and to input high speed analog-to-digital data. One of the most common uses of the single bit "CB2" control line is to generate sound effects when connected to an audio amplifier and speaker. Not particularly well known is the fact that the user port has access to a fairly sophisticated timer (part of the 6522 integrated circuit which supplies the user port function) which again is under user control.

The final hardware item to be discussed is the EXPANSION BUS. These wires are accessible at the right side of the PET and communicate at nearly the lowest possible level to the 6502 microprocessor chip that runs the whole show. Available are buffered address lines 0-11, 4K selects for blocks 0-7 and 9-B,, the buffered data bus, the R/W, IRQ, RESET, and CLOCK signals. The expansion bus is not easily used, since it required detailed hardware

and software expertise on a machine language level. However, it can be used for memory expansion in both ROM, RAM, and 1/0. Several manufacturers make memory expansion boards that connect to the expansion bus.

FIRMWARE

Turn on the power switch of the PET, and you are in the Basic operating system. One of the most important features of the PET firmware is its advanced screen editor. What this means is that as long as your command or program text is visible on the screen, it can be edited with minimum effort. Cursor control keys take the blinking cursor anywhere on the screen, at which point you can overwrite, delete, or insert characters, without having to type in anything additional except RETURN. For example, if you are keying in Basic program lines and discover that you misspelled something 5 lines back, you just position the cursor over the offending area and correct only the error (remember to hit RETURN). Once you get used to this feature, you will look at any operating system that doesn't have this powerful editing feature as "primitive."

Another powerful feature of the operating system firmware is the real-time clock, updated every 1/60 second. Two special variables, TI and TI$, are available to the user for use directly or within programs. This interrupt driven feature also scans the keyboard, and permits lookahead key entry. This feature means that your keystrokes are remembered, even when the system is nominally "busy." Again, you will only appreciate this on comparison with systems which don't have this feature. On the negative side, the inter


62

rupt driver can get in your way in certain machine language programming techniques.

Almost all the commands available to Basic are usable in the direct mode (no line number). This means, for example, you can evaluate arithmetic expressions directly, without writing a separate program. Overall, PET Basic compares favorably in both flexibility and speed with most other Basic's I've seen on other personal computers. PET Basic has a fairly advanced instruction set, including some very powerful string handling functions, and an easy to use IEEE-488 command set. Variables can be integer, real, or string type, and all of them can be multiply subscripted. It also has PEEK and POKE, which allows you to interrogate and alter memory directly. The SYS and USR commands allow you to access machine language routines, but the beginner should be aware that there are many pitfalls (potential crashes) involved.

The final firmware feature that the potential PET user should be aware of is the machine language monitor (MLM). In the early version of the PET, this needed to be loaded from tape. In current versions (Basic 2.0 and 4.0) the MLM is in ROM. The contents of sequential memory locations can be displayed via the command M XXXX-YYYY (XXXX is the start addresses and YYYY is the end address). The nice feature here is the ability to use normal cursor editing to modify either memory locations or register contents. The other commands available via the MLM allow you to execute machine code at a specified address, load and save programs or data on either tape or via an IEEE-488 device, and finally, to return to Basic. The beginner may be reluctant to enter the machine


CREATIVE COMPUTING

Picture

language realm (but why not give it a try? - the command structure is actually simpler than Basic), but the MLM is there if and when you need it.

SOFTWARE

Software is where it's really at - without good software, even the most sophisticated personal computer will look dumb. One of the most important factors one must consider when trying to decide on a personal computer is the availability and quality of software. No one person has the time and ability to program everything; the best you can hope to do is accept the specific challenges which fit your own interests and capabilities. Many fine products (see advertisements in this issue) are available commercially. These cover a range from action games (Breakout, Space Invaders, Zap, etc.), to more serious games (Microchess, Backgammon, 1000 Miles, etc.); from relatively simple applications programs to complete systems (various assemblers, word procesors, financial and business packages, educational packages, etc.). Obviously, the PET has no monopoly on good software nor even the largest share within the market. The point I am trying to make is just that software quality and availability is not a limiting factor in the utility of the PET.

Another aspect that deserves mention here is the fact that the PET has attracted a body of personal programmers who, I

believe, are unsurpassed in imagination, cleverness, and willingness to share the results of their expertise. I don't feel it is appropriate, nor that I am even qualified to mention names, but I would advise the reader to scan the various personal computer magazines and journals to make their acquaintance. The people at Commodore have, perhaps justifiably, not revealed much of the inner workings of the PET (this situation is steadily improving due to the unrelenting commitment of certain Commodore staff members). However, the active community of PET users has done an essentially complete analysis on their own. There is indeed much "hidden gold" within the PET but unfortunately there is no one place where it is documented fully.

In summary, I would say that you really can't go wrong if you choose the PET as your personal computer. My own experience has been excellent in terms of reliability and capability. The PET shows no signs of obsolescence, and continues to be a popular machine. In all fairness, in case it hasn't been clearly stated above, I should restate what I feel are the PET's main weaknesses; its limited graphics, lack of a built-in RESET switch, and incomplete Commodore documentation. In my opinion, its main strengths are; good Basic operating system, advanced screen editor, good hardware/ firmware marriage, IEEE488 support, and broad based software availability.   o