Verify Your Applesoft Tapes
Keith Falkner Venice, FL
To check a tape using this program, rewind the tape after a SAVE (while the program is still also in the computer's memory), type CALL 768, and do not hit return until after you have started your tape.
Imagine this–you've written a dandy program in Applesoft, tested it, debugged it, perfected it, and of course SAVEd it.
But is the program really saved? Can you load the tape? If the tape recorder has developed a problem, you may lose this program forever as soon as you type NEW or turn off your Apple.
Here is how to know for sure. Below is a machine language program which verifies the accuracy of a SAVEd Applesoft program on tape. To make use of this program:
- Type in Program 1 and RUN it.
- From the machine language monitor, SAVE it to tape via 300.393W or to disk via BSAVE VERIFY, A$300, L$94.
- When you need it, BLOAD VERIFY from disk or enter the monitor with CALL-151 and reload it from tape via 300.393R (this does not affect an Applesoft program in memory).
- SAVE the Applesoft program as normal.
- Operate the tape recorder just as you would to LOAD an Applesoft program, but type CALL 768 instead of LOAD. The tape will be read and compared to the Applesoft program.
- If the comparison is successful, there will be no error message, just the two BEEPs which accommpany LOAD.
- If, alas, the tape is not a readable copy of the program, the message ERR will appear, with the address of the error and the values of the byte on tape and the byte in memory.
An error message is never good news, but it is far better to know of a problem before the program is lost than to rely on a tape which later proves unreadable.
An Applesoft program on tape is really two data records: the first record is four bytes long and indicates the size of the Applesoft program. If this header is read accurately, the computer beeps, but prints nothing. The second data record on tape is as long as the header indicates, and contains an image of the program. When this is successfully read, whether by LOAD or by the verify program below, the computer beeps again.
Load naturally shoves the incoming data into memory, but Program 1 harmlessly compares what is read with what is in memory. If those bytes differ, an error message appears: ERR 08EB-88 (8C) for example, which means that at location $8EB, the byte in memory is $88 (the token for GR), but the tape contains $8C (the token for CALL). As soon as it reports such an error, the VERIFY routine quits. At this point, nothing in memory has been altered, so the SAVE can be retried, perhaps with a different tape or a different volume level.
Take the time to type this routine into your Apple and save it. Sooner or later you will want assurance that a saved Applesoft tape is the accurate program you hope it is.
Type in the Applesoft program and it will build this machine language verify routine starting at address 768 when you type RUN.
100 FOR I = 768 TO 915 : READ X : POKE I, X : NEXT 768 DATA 162, 0, 32, 117, 253, 160, 2, 138, 145, 105 778 DATA 200, 169, 0, 145, 105, 200, 169, 2, 145, 105 788 DATA 189, 9, 2, 41, 127, 157, 0, 2, 202, 224 798 DATA 255, 208, 243, 96, 32, 61, 3, 165, 103, 133 808 DATA 60, 165, 104, 133, 61, 165, 175, 133, 62, 165 818 DATA 176, 133, 63, 32, 61, 3, 169, 141, 76, 237 828 DATA 253, 32, 250, 252, 169, 22, 32, 201, 252, 133 838 DATA 46, 32, 250, 252, 160, 36, 32, 253, 252, 176 848 DATA 249, 32, 253, 252, 160, 59, 32, 236, 252, 240 858 DATA 14, 69, 46, 133, 46, 32, 186, 252, 160, 52 868 DATA 144, 240, 76, 38, 255, 234, 234, 234, 193, 60 878 DATA 240, 235, 72, 32, 45, 255, 32, 146, 253, 177 888 DATA 60, 32, 218, 253, 169, 160, 32, 237, 253, 169 898 DATA 168, 32, 237, 253, 104, 32, 218, 253, 169, 169 908 DATA 32, 237, 253, 169, 141, 76, 237, 253