Classic Computer Magazine Archive ANTIC VOL. 4, NO. 5 / SEPTEMBER 1985

Power Programming


Antic's first 130XE program


Copy your disks in one quick pass using the full 128K memory of the 130XE. Features single read/multiple write-and write to multiple drives. Perfect for disk librarians. This fast, convenient copying program requires the new Atari 130XE computer a disk drive, and a Disk operating System that's compatible with DOS 2. It is written in MAC/65 assembly language. But you don't need to know machine-language, we have included a BASIC loader which will create the program for you.

Just bought a 130XE? Wondering what to do with all the extra memory? Me too. I wanted to get started with my new computer by writing a simple program that would use the larger memory; but I didn't know what to do. Then it occurred to me there was enough memory in my 130XE to hold 768 sectors of a single density disk. Single pass disk duplication guaranteed! It was like a dream come true.

All I needed was to write it. I started with a very simple three sector machine language program that simply did a one-pass duplication, switching the banks when needed. But after showing my program to friends and receiving lots of interesting suggestions, more and more features were added. The result is this powerful, multi-purpose sector copying program.


Listing 1, COPY130.BAS, is a BASIC program that will create the binary load version of COPY 130. Type it in and check it particularly carefully with TYPO II. All that data is machine language and must be exactly right! Be sure and SAVE a backup copy before RUNning it.

When you RUN Listing 1, it will read the data and then ask for a device and filename. Place a formatted disk containing DOS 2 or DOS 2.5 in your drive and type D:AUTORUN.SYS [RETURN]. The file will be written to disk, after which you may simply boot the disk without BASIC to automatically RUN the program. Note that you should NOT have the RAMDISK activated if using DOS 2.5 when running this program. If you're using DOS XL from Optimized Systems Software, you can also enter another filename with a .COM extender and load the program from DOS.

Listing 2, COPY130.M65, is the assembly language source code and is included primarily for instruction. However; if you wish you can type it in instead of the BASIC loader. Some of you who are studying the use of the 130XE extended RAM will want to adapt portions of the program for your own use.

AnticDisk subscribers: Use DOS to transfer the file COPY130.EXE to another disk. Then rename it AUTORUN.SYS.


For most uses, the instructions that follow won't even be needed, just follow the onscreen prompts. You won't need to press [RETURN] at any prompt unless told to do so. Pressing [ESC] at any prompt will re-run the program. Those of you who are experienced at using sector copiers might want to skip to "Advanced Usage" for the special features available at some prompts.

Before actually doing the copying, several prompts allow you to use any drive as a destination drive, format a destination drive, verify writes and handle possible errors. There is no provision for indicating a source drive. I intentionally left this out because everyone I know uses drive 1 as the source drive.

The "Destination #" prompt asks which drive (1-8) to use for the destination disk. If [1] is entered, you'll receive an "Insert Destination Disk" prompt after the source disk is read into memory. Any other number will skip this prompt so you must have your destination disk properly inserted at the "Insert Source Disk" prompt.

The "Format ?" prompt asks if wish to format your destination disk(s). Unless the disk you will he copying to is already formatted, answer this prompt by pressing [Y]. Any other key yields a No. The "Verify ?" prompt is asking if the program should verify each sector write by re-reading and comparing each sector. A [Y] here will make the copy take longer, but will insure that the data written is valid. "Continue on Error" is for duplicating a disk with damaged sectors. Unless you know the disk you are reading is damaged, answer [N] to this prompt, otherwise the program will not stop if an error occurs.


After inserting the source disk and pressing [RETURN], the program will begin reading your disk into RAM, and a data window will appear on the screen. The left-most number in this window is the current drive number. The right-most window (which should contain nothing) is the error window. The center window is the number of the sector currently being processed. If the program stops before the sector number reaches 720, an error has occurred and a number will appear in the error window. See Figure 1 for error numbers. If no errors occur; you are prompted to insert a destination disk in the selected drive. Do this and then press [RETURN].



Number    Meaning

0		Non-I/O error (Serious Error-Program Damage).
1		Break key was pressed, causing loss of data.
2		Timeout- Device doesn't respond.
3		NAK- No acknowledge from device.
4		Serial Bus Data error.
5		Write-Protect, open drive or bad sector.
6		Read after write verify error.
7		Unrecoverable system I/O error.
8		Damaged sector links.
9		Bad Sectors found at format time.

When you use this option at the "Destination #" prompt, the destination defaults to drive 1. Set up the variables as explained before, then load the source disk. When you get to "Insert Destination Disk"; load each drive you have-including drive 1-with blank disks. The program will then write the source information to each drive automatically without prompts. Answering [Y] to 'Another Copy?" will go back to the "Insert Destination Disk" prompt where you can reload and write to all your drives again.

When the copy is finished you are prompted for another copy. If you want to make another copy of the source disk already in RAM, press [Y], otherwise press any other key.


When you press [Y] at the 'Another Copy ?" prompt, the program uses the same drive, format, verify and error handling variables that were previously set. To change these without re-loading the source disk, press [ESC] at this prompt, reset your variables, but when you come to "Insert Source Disk- Type Return"; press [N]. This skips the reloading of the source disk, and can also be used if an error has occurred when writing or formatting and you wish to try again.

Three other keys are recognized at the "Destination #" prompt. These are [D], [T] and [Q] which are used to enter the multi-destination mode of operation. Multi-destination mode allows users who own more than one drive to efficiently mass-produce disk programs by writing to multiple drives. [D] is for Double-two drives-[T] is for 'Triple and [Q] is for Quadruple.

Ernie Negus of Portland, Oregon is a regular Antic contributor; specializing in machine language programming

Executable: COPY130.EXE Download

Listing: COPY130.M65 Download / View