Notat Ff Start Fd

was exchange registers, POP the address off the stack and exchange the registers back again.

To create a leader of 40 bytes, my routine calls 01FEH to turn on the cassette motor, loads 40 into the B-register and then calls 0289H, which is the rest of the ROM routine to write the number of bytes dictated by the B-register, followed by one A5 byte.

The patch is 48 bytes long (program listing 1) and is completely relocatable since internal jumps are relative and absolute jumps are made only to ROM addresses. The number of bytes to be written is loaded into the B-register on Line 460. You may need to change this value.

Better yet, the BASIC version (program listing 2) is self-relocating\ It PEEKs at the MEMORY SIZE you have set (if any), deducts enough room for the patch, POKEs in the patch, sets a new MEMORY SIZE and resets all necessary pointers. Therefore, if you are already using other patches or routines in high memory (like KBFIX, KBEEPFIX, a printer driver, or whatever), the BASIC version of this patch will relocate itself just below the other routines automatically. Make sure it is the last patch you load, otherwise you might load some other non-relocatable routine right over it and destroy it.

If you run the program more than once, it will continue to relocate itself each time you run it. There would be multiple copies of the patch, but only the last one loaded would be in use.

The patch I have presented here will not interfere with other routines. CSAVE, for example, will still write 256-byte leaders in front of program dumps. If you have any USR routines located in high memory, this program will not interfere with those, either.

How to Use the BASIC Version of the Patch

First, load in any other utility routines you need. Then, CLOAD the BASIC version of the patch and RUN it. It will ask you how many bytes you want in your leader. Then, CLOAD your main program and RUN it. If your program has INPUT# statements in it, "old" tapes with long leaders as well as "new" tapes with short leaders will be read. With the patch in place, PRINT# will only write tapes with short leaders.

You will need to experiment with your particular computer/recorder combination to see what length leader you need to use. Perform the following test until you are satisfied that you have found the minimum length leader:

1. Generate a data tape using the program below:

This program will write the numbers from one to ten onto tape, each number preceded by a leader.

2. Read this tape back into the computer using the program:

0 0

Post a comment