PET To VIC Or 64 Transfers
In connection with your article on merges in the June 1982 issue of COMPUTE!, I stumbled onto something which I have never seen reported, although something so simple must have been noticed by someone else. I tried loading programs recorded on a cassette on my PET (Original ROM from 1977) into my new Commodore 64. I found that the program appeared to load and would apparently list OK. However, it would not RUN, and one could not list individual lines or groups of lines. Also, on closer examination of the listing, I found that the first line of the original program was missing, and in its place was a 4 or 5 digit number.
I found by experimenting that I could convert the program as loaded into a normal program by a very simple procedure. I started a LIST, but stopped it (with the STOP key) while the first line was still on the screen. I then positioned the cursor first over the number which had replaced the first program line, then executed a RETURN, and then a second RETURN when the cursor was over the second line (which now appeared to be the first). After that, the program could be edited and RUN normally (after replacing the first line, if necessary). I have now used this procedure to transfer a number of programs from my 1977 PET to the 64, but put a line like:
10 REM JUNK LINE
at the beginning of each program before recording it on the PET. You and others are probably familiar with this, but I have not seen it anywhere. It is a very simple way to transfer programs from one system to the other. I presume this would also work on the VIC-20, and I intend to try this as I also do some programming on a VIC-20 at a school for handicapped children.
Jim Butterfield replies:
Your letter draws attention to something that is not well known. The very first Commodore computers – the "Original ROM" PETs – saved programs in a slightly different way from all subsequent Commodore machines.
It worked this way: just before the beginning of your BASIC program there is always a value of zero in memory. This is still true, even in VICs and Commodore 64s. But the first model of PET saved programs including the zero. All subsequent Commodore machines saved only the program — not the zero.
This meant that early PETs saved programs with a Load address of 1024; and that all subsequent PET/CBMs saved with a Load address of 1025. On the PET/CBM computers, this made little difference: programs did not relocate, and were loaded back to the right place. With the arrival of the VIC and the Commodore 64, however, programs became relocatable; and these new machines did not expect the extra zero. Result: a confused first line.
The easiest way to fix up this problem is to LOAD them to any newer PET/CBM and then SAVE them once again. The zero will be dropped and everything will become compatible.