• Please review our updated Terms and Rules here

PET - COPY syntax to copy files from one drive to another

ScottishColin

Experienced Member
Joined
May 16, 2012
Messages
152
Location
Perth, Scotland
I have a PET DISK Max 2.0 as id 9 and a 4040 as device 8 and I'm probably being dense, but I can't work out the syntax to copy a file from one to the other.

All the examples I can find online or in books show me how to copy from disk 0 to disk 1 on the 4040 but not to/from a different disk drive on a different id.

Is anyone able to point me in the right direction please?

I have a Tynemouth ROM/RAM board so can run BASIC 2.0 or 4.0.

Thanks.

Colin.
 
Unfortunately, Commodore disk drives have no way to copy from one device to another device.
Dual drives like the 4040 can copy from drive 0 to drive 1, but that happens entirely inside the drive. The drives have no way to copy directly from device 8 to device 9 for example.
To do that, the PET would need to read the data in and then write it back out to the other drive. There's no built-in command for that, but there are some programs that can do it.

Of course the easiest way is to load from one and then save to the other,
but give me a few minutes and I can point you to at least one program that can copy from disk to disk.

Update: Copyall by Jim Butterfield (for the PET) is the program I used before.
Look for "cbmutildisk" here ... http://www.zimmers.net/anonftp/pub/cbm/pet/utilities/index.html
There may be some others in there also.
 
Last edited:
Copyall by Jim Butterfield (for the PET) is the program I used before.
Hutch,
Thanks for mentioning the author as that's a name to remember. Lest we forget. Jim Butterfield was one of the original Commodore PET experts going back to the beginning. He was one of the founders of the Toronto Pet Users Group (TPUG). Our very own forum member MikeS was a friend of his.
 
Sadly none of the programs there work - I'm guessing they're looking for something on the PET DISK MAX networked drives, or from the PET DISK MAX itself that isn't there.

Colin.
 
Sadly none of the programs there work - I'm guessing they're looking for something on the PET DISK MAX networked drives, or from the PET DISK MAX itself that isn't there.

Colin.
Probably using the standard Commodore disk drive commands to create files and transfer data, but the PetDisk doesn't support most of the Commodore disk command set.
Load and Save may be your only option.
 
Thanks. Was it never envisaged that customers would have two disk drives connected at the same time do you think?
Back in the day when I actually used a PET with a floppy drive, they were dual drive units. 4040 or 8050.

Copying from 0: to 1: with the same unit number was a simple command, but copying a file between devices (different units) was not easily done.

I've run into the same problem with my Plus/4 where I have a PI1541 set up as device 8 and a real 1541-II set up as device 9.
 
Just thought of another question - if people had an external hard disk drive on their PET, was there no way to copy files from the floppy disk to the hard disk?

Colin.
 
from the manual http://www.primrosebank.net/compute...nual_D9090_D9060_8250_8050_4040_2031_text.pdf

It suggests that the COPY command can get the drive to communicate with another drive and copy a file.

COPY
This command creates an identical copy of a file, either on a different drive (or device number) or, with a different file name, on the same disk.

Format: COPY [Dsdr] [onu#] ,"sfn" TO [Dddr] [onu#] ,"dfn"

Example COPY DO, "names" TO Dlonu9, "friends" 18 This will copy a file called "names" on drive unit # 8 to drive 1 on unit # 9. The name of the new file is "friends". The COPY command may be used with pattern matching to copy several files at a time. If the file name already exists on the destination disk, an error condition results and the copy is not done, emission of source drive number causes a search of both drives for the file. Destination drive number defaults to 0.
 
How odd.

What drives do you have ? Do you have the hard drive ?

The copy command would be run by the drive specified as the source drive I imagine. I wonder if you had to have a DOS of the same rev as the hard drive to make it work ?
 
Of course, the syntax explanation in the manual is cr*p... Therefore, it is just possible that it will do the COPY - you just have to work out the correct syntax to make it do what you want. It would be extremely weird if you couldn't copy from one device number to another. I am sure I used to do it at University with the disk drive and plotter (but that was hmmm years ago now and those brain cells have died off long since).

Dave
 
AFAIK, it's never been possible without the use of a program to transfer the data via the computer.
Hence the existence of such programs.
Not surprising that those programs don't work with the PETDisk Max, since that device only supports a small subset of Commodore DOS commands.
 
One of the Commodore PET threads this week did reference a program to copy files between disk drive units. I remember thinking about it at the time, but now I have forgotten where it was.

I think the thread involved @dave_m and @Hugo Holden if my memory serves me correctly.

Dave
 
I stumbled across a disk-copy program/utility for the PET, but I was not able to get it to work. I have been loading & saving to get files from my SD2PET (device 8) to my SFD1001 disk drive set up as device 9. It would be nice to be able to copy the entire disk.
 
Loading and saving works fine for basic programs, but I'd like to copy some assembly programs over from petdisk.
Here is a way using the PET built-in Machine Language Monitor. Note the 2001-8 PET does not have a built-in Monitor.

If you do not know the starting address and size of the machine code, then examine the file with a binary editor like HxD. The first two byes in the file is the starting address in low bye high byte format. Peruse the file and determine the size of the binary data in hexadecimal.

LOAD the file into the PET.

Start the machine language monitor by causing a break instruction to execute:

sys 0400

SAVE the data to the disk using this exact syntax with no spaces before or after the commas.

.s "0:test file",08,0800,0C80

where 08 is the device number
0800 is the starting address
0C80 is the last address plus 1. i.e., data in address 0C80 is not saved.

EXIT the Monitor with:
.exit

Notes:
1. With dual floppies, when saving to the disk, always specify the drive number ( 0: or 1: ) or your floppy may get corrupted. This certainly applies to the 2040 drive.
 
Back
Top