Home Page  


LAST ARCHIVE

 


ARCHIVES INDEX

 


NEXT ARCHIVE

 

Archives Index


23 January 2004

PET PRATTLE - 6

Joe Griffin


 

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

the only replacement for an
8032 is another 8032!

Extended Memory - 8096 & 8296

As I mentioned earlier in this series, in 1981 Commodore introduced a variant of the 8032, with additional memory. This machine, called the 8096 because of its 96K of RAM, did not give the user immediate access to the full memory. At start up the familiar "31743 bytes free." message appeared. As far as the BASIC programmer is concerned, these machines are 8032's; there is no extra memory available.

Commodore made the 8096 available as a machine in Its own right, or as an upgrade by way of a user (or dealer) installable board containing the additional chips. There were at least two independent boards available at the same time, though from my own experience I can say that one at least of these was not fully compatible. On my machine at work, we upgraded to 8096 with a third-party board. This promptly crashed the machine. After two months of to and fro'ing with our dealer we discovered that a detail change in the mother board of one series of 8032's was compatible with the CBM board but not the third party one. Our eventual solution was to fit a genuine Commodore board..

With the expansion (either as a board or a complete machine) came the customary collection of paper and a disk ( 4040/ 8050 flippy)..

Of the documentation supplied, the fitting instructions, instructions for a demo / test program and assembler listing for a program to 'toggle most of the gates within the 64k add-on' were trivial. The user guide, while still of the usual Commodore standard did give 7 pages over to operation, while the assembler listings of the extended memory monitor, soft-system loader and 'Expanded BASIC' provided a useful amount of information..

The disk included both assembler source code and binary programs for the three programs mentioned above, together with soft-loadable versions of BASIC 2 (Upgrade ROM) and both 40 and 80 column BASIC 4..

The source code for both Add-on-Load and Add-on-Mon contained small bugs. In Add-on-Load, if the named operating system could not be found, the program re-tried for a new file name but no message was displayed. There was no graceful exit from the program. Two simple mods to the source correct this. In Add-on-Mon, the bug is more severe. When performing a SAVE from the monitor, the pointers to the start address of the save were not set up - fine if the program just loaded was being re-saved, but disastrous otherwise..

The Extended BASIC program is definitely the one used to prove the definition of 'Test Data'. For those who do not know it "Test Data is that Unique set of data which allow the program to work". In the case of Extended BASIC, a set of example programs were supplied. These worked! I never got any real examples to, nor did several correspondents of mine..

Expanded BASIC was supposed to be a pseudo-cache system, storing programs in the expansion and allowing them to be rapidly paged in or out of conventional memory. If anyone did manage to sort out the bugs and reliably make it work, then I would be interested to hear from them or receive a copy of the modified routine..

(note from k.r. 2004 ~ at one point had a set of home brew prgs running with Expanded BASIC created in one 8096 machine that wouldn't behave in another 8096 ~ with no clear reason why )

Hardware

The 64K of RAM on the expansion board was configured as 4 blocks of 16K. Blocks 0 and 1 mapped into the range $8000 to $BFFF and blocks 2 and 3 mapped into $C000 to $8FFFF. if the expansion was enabled, two of the blocks replaced the upper 32K of the 8032..

Control of the expansion was through a single write only control register at $FFFO (65520) The bits of this register were used as follow:.

Bit 7 - Enable (1) or Disable (0) the expansion memory
6 - Enable (1) or Disable (0) 110 peek through ($E800 - $EFFF)
5 - Enable (1) or Disable (0) Screen peek through ($8000-$8FFF)
4 - Reserved
3 - Selection of 16K block for $C00 -$FFFF (0=block 2, 1 =block 3)
2 - Selection of 16K block for $8000-$BFFF (0=block 0, l=block 1)
1 - Enable (1) or Disable (0) write protection for $C000 $FFFF
0 - Enable (1) or Disable (0) write protection for $8000-$BFFF

If I/0 peek through is enabled (bit 6 set) then I/0 is not write protected, irrespective of the state of bit 1. Similarly, if screen peek through is enabled, then the screen is not write protected, even if bit 0 is set..

The simplest way to check whether an 8032 has the expansion board fitted is to POKE 65520,227 if the machine crashes irretrievably then there is an expansion fitted. If it does not crash, then there is no expansion; the poke had no effect and the 8032 continued operating from ROM..

For the 6502 microprocessor three important hardware vectors are stored in ROM at $FFFA - $FFFF. These vectors are nonmaskable interrupt (NMI), reset and interrupt request (IRQ). In order for the 8096 to use the expansion memory there must be a valid address in the 16K block in use (unless interrupts have been disabled by an SEI command before the expansion is turned on). The User Guide contains an example of the sort of routine required. This disables interrupts (SEI) and sets the vector addresses to point to code in conventional RAM. The code merely switches out the expansion, carries out the required interrupt and returns to the expansion. As mentioned above, the control register is write only, so it is up to the user to keep a record of what expansion configuration is in use..

Software

All this was pretty tiresome stuff if you were not a machine code addict, or if you just wanted to use BASIC. There were a couple of packages around which did allow the BASIC programmer to use the expansion. When we got our 8096 at work, our dealer supplied us with a program called LOS-96 (Loadable Operating System). This allowed 32K for BASIC and 32K for variables. The other main features of the system were:.

Virtually unlimited FOR/GOSUB stack
Program change without loss of variables
ESC key functions for screen control codes
Automatic program line numbering
Line block Delete facility
Device 8 default for load & save
REDIMension single dimension arrays
RESTORE to a given data item
Improved string handling (GET$, INSTR, MIDSTR)
IF ... THEN ... ELSE supported
ON ERROR construct
PRINT at and PRINT USING were both provided

There was also a 'System 96' package available from Dataview which allowed access to the expansion memory. This could interface with the DTL Compiler to allow compiled program using more than 32K. Unfortunately the PetSpeed compiler was never released in a 96K version, though this was planned at one stage..

One other program was available which made use of the expansion memory, and which allowed access to more than 31K for non machine code programmers. COMAL was released for the 8096 in version 1.02 which gave a very useful amount of workspace..

Most of us used our 8096's to run commercial packages. One of the first was Visicalc (as I mentioned in Prattle 4) others were Silicon Office, Calc-Result and Precision's threesome; Superscript, S-base and S-office (the latter being a combination of the two others). All these packages are large programs and in an 8032 would have little or no work space. By making use of the expansion memory area, they allow the programmer to have his cake and eat it!.

For machine code programmers, a non-commercial, but excellent, program which makes use of two banks of the expansion is the Go-faster Assembler, written by David Prentice of ICPUG-SE. This can be 'installed' so that it is ccresident with the source code. This allows much faster assembly, as there is no reading from disk, merely from RAM. I was fortunate enough to be given the source code by David, so I was able to modify it slightly to allow it to use the other banks of the expansion as the 'ROM'. I will explain this further..

Soft-loaded systems

On the disk supplied with the 64K add-on was a short program called 'ADDON-LOAD', together with its source code. When loaded and run, this program requested the name of a SYSTEM, which it then loaded from disk. On the original disk were three systems 'BASIC 2.0', 'BASIC 4.0/40' & 'BASIC 4.0/80'. Any of these systems could be loaded, so you could, for example turn your 8096 into a 3032, with Business keyboard. So far, so good..

As I mentioned in Prattle 5, the Basic-Aid program added many programmer's commands to BASIC. The source code of this utility allows it to be assembled for ROM, the idea being that it could be blown into an EPROM for one of the empty slots in the PET, thus saving 4K of RAM. On my system, I assembled it to use the $A000 slot and similarly assembled MICROMON to use the $9000 slot. By using Add-on-Load to load a soft version of 80 column BASIC 4, I could then poke location 65520 with 224 (to remove the write protection) and load in the two sets of EPROM code. Using the built-in monitor (as Micromon does not recognise $G00O as a valid address), the memory from $9000 up to $FFFF could be saved to disk (remembering to allow one extra byte to get over the bug in the save routine). From then on, the Add-on-Load program could be used to bring in the extended operating system just created..

Similarly, when Tom Cranstoun let me have a copy of the source code for his Scrolling Editor, a copy of this was prepared for the. $A000 slot. When I want to work in machine code, I can load the soft-system containing the editor. If I want to go over to BASIC, I merely replace it with the one containing BASIC-Aid..

By loading one operating system into banks 0 & 2, and the other into 1 & 3 (using a modified version of Add-on-Load), it is possible to switch between them, without disturbing the program currently in memory. As long as the 'EPROM' has been disabled (with KILL, or whatever), a direct POKE to address 65520 will flip between systems. The following values cause the expansion to enable the memory blocks indicated.

POKE 65520,224 - Blocks 0 & 2 write enabled
227 - Blocks 0 & 2 write protect
230 - Blocks 1 & 3 write enabled
233 - Blocks 1 & 3 write protect

> This can of course be just the start! My PET was hooked up to an Epson FX80, which had a normal IEEE card, not one giving conversion to PETSCII. Many moons ago, Lee Alien of Aftek wrote an article for ICPUG-SE detailing a modification to the 'F' ROM which allowed true ASCII output to channel 5 of an IEEE device (unit 4 or greater). My soft-loaded system includes this modification. To obtain correct printing from the Epson, I 'OPEN 5,4' and the modified code handles the conversion..

Other features which I wanted on my system, and which could be easily patched in to the operating system, included the ability to recognise hex numbers and to provide a conversion from decimal to hex, with a new keyword HEX$. Computed GOTO/GOSUB were also included as was RESTORE to a line number. The ability was also included to produce certain graphic characters by pressing shift with single character keys (square-brackets, commercial-at, left arrow, up-arrow, back-slash and numeric keypad)..

The 8096 was a very versatile machine: little wonder that it made Commodore the leaders in business micros. A lead which they lost with the 700 when the rest of the industry was turning to the 8088 and IBM compatibility. The final testimony to the 8096 must come from Commodore who re-introduced it after the 700 was abandoned. In its new guise as 8296, with the -D (disks) and -GD (hires graphics & disks) variants it had a further lease of life. Just recently I heard of a dozen 8296 for sale at under £50 each anyone interested?.

Next time I will talk about Commodore lEEE disk drives..


 

 

 

 


TOP