OPEN15,8,15:PRINT#15,"&filename":CLOSE15
.
Byte Description ---- ----------- 0 Next file block's track 1 Next file block's sector 2 Start address low order 3 Start address high order 4 Number of bytes in this program part (0 means 256) 5.. Program code bytes ..X last program code byte X+1 Checksum of the program bytes X+2 Start address low order X+3 Start address high order ...This means that "&" file may consist of multiple parts, each limited to 256 bytes. A program part's checksum byte is calculated by adding all the values of the bytes, starting at the low order start address (byte 0), while adding you subtract 255 from the total every time it exceeds 255. In machine language, you can do it even easier:
39, FILE NOT FOUND
50, RECORD NOT PRESENT
51, OVERFLOW IN RECORD
62, FILE NOT FOUND
:
63, FILE EXISTS
,
otherwise it is 62, FILE NOT FOUND
. Judge for yourself which
works better.
The following was taken from RUN magazine, Sept 1988 Issue, Magic Trick $4CC, page 12.If your 1541 or 1581 disk drive hasn't been behaving well lately, it may be out of alignment. You could take it to a repair shop, but before you shell out $0 or $50, try "knocking" some sense into it with my Reverse Knocker program.
This 64- and 128-mode program reverse-knocks the drive head 100 times, which may re-align the drive just enough to postpone and expensive realignment. Be forewwarned: have an old work disk in the drive when you run it, and don't worry if running this program makes your disk drive sound like a smoldering Buddy Rich drum solo. It is a noisy program, but if you type it in correctly, it won't hurt the drive or disk at all.
0 REM REVERSE KNOCK YOUR DRIVE - STEPHEN CHEUNG 10 OPEN 15,8,15,"I" 20 SP=1:FORI=1 TO 100:GOSUB40:NEXT 30 FORI=1 TO 20:SP=-1:GOSUB40:NEXT:PRINT"ALL DONE!":PRINT#15,"I":CLOSE15:END 40 PRINT#15,"M-R"CHR$(0)CHR$(28):GET#15,A$:A=ASC(A$+CHR$(0)):BI=A AND 3 50 BI=BI+SP:BI=BI AND 3 60 R=(A AND 252) OR BI: PRINT#15,"M-W"CHR$(0)CHR$(28)CHR$(1)CHR$(R):RETURN