Home Page  


LAST ARCHIVE

 


ARCHIVES INDEX

 


NEXT ARCHIVE

 

Archives Index


18th November 2002

PET PRATTLE 3

Joe Griffin


 

(This article was first published in the ICPUG Journal July/August 1988 issue.
Permission from Joe Griffin to republish on the Internet has been received.)

the only replacement for an 8032 is another 8032!

The History of Commodore BASIC

In 1977 when Commodore developed their first ever microcomputer with an inbuilt BASIC interpreter, they negotiated with Microsoft and bought a version of the language, rather than merely licensing the rights to use it. As a result, over the years we have been tied to the frequently slated 'Commodore BASIC' rather than having the bells and whistles of more recent offerings. The big advantage of this fairly standard BASIC is the portability between different issues of the product. The first PETs came out with what has grown to be known as BASIC 1.0 (or Original ROM BASIC). When CBM introduced the Upgrade ROM in 1979, there were substantial changes to the operating system but although the BASIC interpreter was also changed internally, including a number of bug fixes, the user interface hardly changed at all. BASIC 2.0 as it is called has only a single extra keyword. GO was introduced as a token in its own right, allowing the interpreter to recognise GO TO in addition to GOTO.

Programs which are pure BASIC 2.0, (no PEEK, POKE, SYS, USR or WAIT) will work without any modifications on any 8-bit Commodore machine.

Commodore BASIC has evolved along two separate lines. The PET/Business machine range has developed BASIC 4.0, though there are incompatabilities between the extended BASICs of the 8096 (LOS) and the 700 series. On the colour computers the BASIC has evolved from the same BASIC 2.0 origins in an upwardly compatible manner.

BASIC 2 & 4

BASIC 2.0 was standard on the 3000 series PETs and was later taken across to the Vic and C-64 machines. When Commodore introduced the 8032, knowing it was to be a business machine and that disks would be the norm, rather than the exception, they included disk commands as standard. The disk commands of BASIC 4.0 can, with one exception, be obtained by other means in BASIC 2.0, but the syntax is more cumbersome. Using BASIC 2.0 commands it is not possible to view the directory without destroying the current program. Most users therefore use a machine code wedge program which does allow non-destructive directory viewing. The BASIC 4.0 commands were in addition to the earlier commands and a pure BASIC 2.0 program will run on the BASIC 4.0 machines without changes.

LOS-96

In 1981 the 8096 appeared and in Germany SM Software developed an extended BASIC in the form of a Loadable Operating System. The product was known as LOS-96 and contained 17 additional commands and functions. These included ELSE, for IF ... THEN ... ELSE, and USING, for PRINT USING. Some 8096 machines were supplied with a copy of LOS-96, though there was very little documentation in evidence. I do not know the level of support provided with the copies of LOS-96 which were sold by SM Software. For the first time a degree of incompatability crept in, as LOS-96 stored its programs at $8000, in the additional memory, rather than in conventional memory at $0401. LOS could relocate programs, so moving up to LOS was simple but it was more difficult to transfer programs back to a standard PET.

BASIC 4+ on the 700

With the arrival of the 700 series, Commodore took across some, though not all, of the additional keywords from LOS and added others. Needless to say the new 700 keywords followed on directly from those of BASIC 4.0, with scant regard for those of LOS. Thus we see the LOS keyword DELETE becoming DCLEAR in BASIC 4+ when the same program is loaded onto the 700. However, the additional tokens are few in number and relatively specialised so conversion should not be too much trouble. As for LOS, BASIC on the 700 (and all future machines) was relocatable so upward transition is easy, backwards is harder.

Back to BASIC 2 - Vic and C-64

When the colour computers appeared, they were supplied with BASIC 2.0. Many rumours have been spread on the lines that the BASIC 2.0 chips 'just happened to be Iying around'. More likely is that a conscious decision was made to use BASIC 2.0 for speed and ease, as it was thought that no-one would use a disk drive with such a hobby computer. Remember that at the time Commodore only produced dual drives and these cost about £600-800. Even though these machines lacked the disk commands, they adhered to the standard command set.

Plus 4 & C-16 BASIC 3.5

The arrival of the Plus 4 and C-16 in 1984 saw the first moves towards providing simple graphics commands on Commodore machines. A collection of 59 additional keywords was provided, which induded some though not all of the BASIC 4.0 disk commands. Why the token values of all the disk commands were changed must remain a Commodore mystery but now we see a major incompatability. These machines will not accept the earlier BASIC 4.0. (Perhaps that's why it is BASIC 3.5!).

BASIC 7.0 on the C-128

With the 128, the additional BASIC 4.0 disk commands were added, along with simple to use sprite and sound commands. This BASIC was upwardly compatible with the other colour machines, though not with the PET range.

40/80 Column Screens

One of the main differences between the BASIC 2.0 machines and most of those running BASIC 4.0 is the screen width. The majority of the 'business machines' have an 80 column screen. Very early in the life of the 8032, this was seen as a problem by many new owners, as a lot of their software would not run on the wider screen. Enter Chuan Chee! I know little about Mr Chee, except that he devised a very effective method of making an 8032 forget about half its screen. On the 8000, the screen is vectored. A machine language program intercepts the screen output and performs the appropriate formatting for 40 columns. In addition to publishing his routine in Compute!, he placed it into the public domain for the benefit of the rest of us. Some time ago, at work, we had one machine which would not run a stable screen with this program but a second version of the program was found and this appears to work on any vintage of 8000 machine.  ( If anyone else has an 8000 machine which will not run an 80 to 40 converter, try a different version / source ?) .

Unfortunately I do not know of a similar routine for the 700 series.

One use of the 40/80 conversion which I discovered a few years ago and reported in ICPUG-SE Newsletter is to allow twice the number of lines when editing in the original Superscript.

I was using Superscript to edit a Visicalc file, when I ran into limitations due to the fact that with an 80 column display, only 250 lines of text are available, whereas with 40 columns 500 lines can be used. (Visicalc lines are very short and would not go beyond 40 columns). Could 40 column Superscript be used on an 800b series PET?

I tried soft-loading BASIC 2.0 and BASIC 4.0 on the 8096, but in each case Superscript failed to work correctly.

I then re-configured the screen with "CBM 4032 C.CHEE" and loaded Superscript. GREAT - 80 column Superscript, folded in two.

Finally I tried loading the Fat40 version of Superscript onto a reconfigured screen by typing dload ''?5*'' and this time it worked, I had 40 column Super script down the centre of the screen.

The "CBM 4032 C.CHEE" program can be set to add gaps between lines and default to lower case, by changing two bytes only in the code. Printing chr$(14) has no effect once the screen has been re-configured.

In order to produce the lower case version of "CBM 4032" the following steps should be followed.

1) Load "CBM 4032 C.CHEE"
or "CBM 4032 V2"

2) Enter the monitor.

3) Alter the line spacing from 7 screen rows/line to 9:

.m 0478 0478
.: 0478 00 07 00 00 10 00 00 00
.: 0478 xx 09 xx xx xx xx xx xx

4) Alter the mode setting to jump to the lower-case set-up routine at $eO7e,
instead of the UPPER-CASE routine at $eO86:

.m 04c8 04c8
.: 04c8 10 a2 84 20 86 eO 60 20
.: 04c8 xx xx xx xx 7e xx xx xx

5) Resave from the monitor.

. s "0: cbm 4032/1 c",08,0401,07a8
or .s "0:cbm 4032/1c v2",08,0401,07a8
 

BASIC 2.0 on 8000 series

Owners of 8096 and 8296 machines can nun any BASIC 2.0 program directly, by using the soft-load system provided with their machine. The program 'ADD ON-LOAD' allows a binary image of other BASICs to be loaded into the expansion memory. A patch is applied to keyboard decoding routines and the video controller chip is re-initialised to suit the appropriate screen width required.

It should be noted that as supplied there is a bug in the ADD-ON-LOAD program (Heavens ! Whatever next?). If the file specified cannot be found on the disk, no prompt is given for the user to re-enter the file name but any further typing is taken as input for the file name. It is impossible to use a null retum to exit from the program. So unless the correct file name is known, the only way out is to reset the machine, using the switch at the back!

Next time I will discuss some of the packages which are (or were) available for the PET.


 

 

 

 


TOP