VIC/PET BASIC Program Transfers
BASIC programs flow easily from the PET to the VIC. VIC has a relocating feature that repacks the incoming program into whatever space that VIC has available. That's a necessary trick: BASIC may start in any of three different locations within the VIC depending on what extra memory has been plugged in.
It's a little more difficult to transfer programs from the VIC to the PET. The stable PET/CBM system expects a BASIC program to be set up for one specific start location. The PET isn't equipped to handle this flighty VIC format which seems to hop around from place to place.
So for VIC-to-PET transitions we need to cope with a "memory mapping" problem. There are several ways to approach this; some of my favorites are itemized below.
Keep in mind that we're discussing BASIC programs only. Machine Language may need different and special handling. And don't forget: PEEKs, POKEs, WAITs, USRs, and SYS's will probably need coding changes to work successfully in the new environment.
A Few Methods:
1. LOAD the program into the VIC with the 3K expansion module in place. SAVE the program. The program will load correctly into the PET with no further modifications needed.
Note that the VIC must have the 3K expansion and no other. The 8K expansion job won't work.
2. Before loading the VIC program into the PET, type NEW; then FOR J = 0 TO 2:POKE 4096 + J,0:POKE 4608+J,0:NEXT J.
Load the program into the PET. Type LIST. If the program isn't there, type POKE 41,16. Type LIST. If the program still isn't there, type POKE 41,18.
Don't forget to reset your PET when you've finished playing with the VIC program.
Each of the above combinations corresponds to a VIC configuration at the time the program was saved. If 3K expansion was in place, the first LIST will work without any POKE (see method 1). If no memory expansion was there, POKE 41, 16 will do the trick. If 8K or more was there, POKE 41, 18 is the magic combination.
3. There's another technique available called a Merge. Space is insufficient to outline the whole story here. Suffice it to say that you can use a complex piece of magic to perform a cassette tape Merge; you can use special software for a disk Merge (for example, Power has this feature) or you can use a machine language program specially written to do the trick.
The capability of merging BASIC lines together is quite important: its usefulness extends far beyond the simple objective of transferring programs between machines. [See "BASIC Program Merges" in this issue.]