Commodore PET ROM descriptions
(C) - André Fachat
This page describes the different ROM versions. There are basically three parts of each ROM set - for the BASIC ROM version and for the so-called editor ROM, and then the kernal.
News:
- 2010-08-28 Added links to history of MS BASIC and Bill Gates' programming tricks.
Table of content
Differences in Software
Basically there are three different ROM versions that came with the PET computers, the original ROMs, the upgrade ROMs and the 4.0 ROMs. Here are some of the peculiarities of the different ROM versions. (I wished I had more about that; see also the petfaq file)
ROM images can be found in the CBM archive
A reverse engineered BASIC source code for versions 1,2 and 4 can be found in the CBM archive.
Original ROMs ($C000-$FFFF)
Original ROMs, from $c000, powers up *** COMMODORE BASIC ***.
To be found in the calculator-style keyboard machines. Horribly broken,
especially the IEEE488 did not work. The
very low level routines worked, but on top of that a lot had to be fixed.
In upper/lower case character mode (as opposed to upper case/graphics mode)
the upper and lower characters were exchanged (SHIFT for lower case).
Arrays could only be 256 elements in size.
There are a lot of other bugs...
Note that these ROMs had a kind of copy protection: the BASIC PEEK function could not read out the actual ROM values...
Upgrade ROMs ($C000-$FFFF)
The `upgrade ROMs' were also known as 2.0 or 3.0 ROMs. Start at $c000, power
up ### COMMODORE BASIC ###
Fix a lot of bugs and make IEEE488 work. Also adds a tiny machine monitor.
Those ROMs have most bugs fixed, although there seem to be different levels
of bug fixing (the
products list
says something about ROM versions 2.0-2.3).
Try and enter "WAIT 6502,1"...
4.0 ROMs ($B000-$FFFF)
Power up with *** COMMODORE BASIC 4.0 ***.
The 4.0 ROMs add the so-called DISK-BASIC with disk operation commands
(DLOAD, DSAVE, COPY, SCRATCH, DS$ for the error channel etc). The editor
ROM still differs from small screen and large screen versions (board #2 and
boards #3 and #4)...
BASIC History
The BASIC as used in the Commodore PET computers is actually something programmed by Microsoft - in parts maybe even by Bill Gates himself. At least a comment in the pagetable's MS BASIC history is supposed to be by Bill and says he put the WAIT easter egg there himself (I'd take that with a grain of salt though).
Anyway, the link below is a great analysis of the different MS BASIC versions, including the versions for Apple and Altair and how they relate to each other.
In the second link it is discussed whether Bill Gates could write code. In fact I believe he could. The Commodore BASIC actually uses the "BIT ABS" opcode often to hide a two-byte opcode in the ABS operand. That was also in the Altair's 8080 BASIC version written by Gates.
In fact it could even be his influence that this technique was later used even in the Commodore kernal. The BASIC 1 kernal for example uses
F0B6 A9 40 TALK LDA #$40 F0B8 D0 02 BNE ATNOUT F0BA A9 20 LISTEN LDA #$20 F0BC 48 ATNOUT PHAwhile the BASIC 4 kernal uses
F0D2 TALK LDA #$40 F0D4 .byte $2C ; BIT $20A9 note: the "LDA #$20" is hidden in the operand! F0D5 LISTEN LDA #$20 F0D7 ATNOUT PHAI didn't do a further thorough research though.
Editor ROM
In addition to the BASIC (including the kernel) there are different `editor' ROMs. Those ROMs occupy $e000-$e800 and contain (in the 4.0 ROMs) the screen handling routines. The 4.0 ROMs can be found in machines with and without CRTC, so they had different editor ROMs. Also the business and graphics keyboard differ in layout, so these editor ROMs differ too. The changes for business and graphics layout in the upgrade ROMs are in $e000-$e800 too. Later on there were nationalized keyboard versions with additional ROM in $e900-$efff. In fact the so-called 50Hz and 60Hz versions have different keyboard layouts and thus different editor ROMs.
For keyboards please have a look at keyboards section.
Character ROM
The character ROM is the ROM that is used to produce the characters on the screen. Therefore the scan line number (0-7) is used as address for the ROM (A0-2), then the 7 lower bits of the byte read from the screen memory (A3-A9), then the VIA CA2 line as switch between upper/lower case mode and upper case/graphics mode (A10). This gives a charrom size of 2k.
You will notice that the highest data bit of the character read from the screen RAM is not yet used. It is instead directly fed to an exclusive-OR gate to invert the pixel stream from the character shift register. This inverts the character by hardware.
The newer models have another line from the CRTC to the character ROM, namely CRTC MA13 is used as A11 for the charrom. With this line you can switch to a completely different character set in the charrom. I assume this is used in nationalized machines with different charsets.
Return to Homepage



