10 REM 'RESCUE' Program for 20 REM saving deleted files 30 : 40 ON ERROR PROCerror:END 50 MODE7 60 DIM block% 12 :REM data block for disk operations 70 : 80 REM Change the beep 90 *FX213,30 100 *FX214,1 110 HIMEM=&2FFF:B%=&3000 :REM File is stored in RAM starting at &3000 120 : 130 PRINT CHR$(141);" DISC PROGRAM RESCUE" 140 PRINT CHR$(141);" DISC PROGRAM RESCUE" 150 VDU28,0,24,39,5,12,15,3 160 Q$=STRING$(60," ") 170 : 180 REPEAT *FX15,0 190 INPUT TAB(0,1)"Please enter drive number (0 to 3) [0x08] [0x08] [0x07] "drive% 200 UNTIL drive%>-1 AND drive%<4 210 : 220 REPEAT *FX15,0 230 INPUT TAB(0,4)"How many sectors do you wish to save (maximum = 70) [0x08] [0x08] [0x07] "F% 240 UNTIL F%>0 AND F%<71 250 PRINT TAB(0,11)Q$ 260 : 270 REPEAT *FX15,0 280 INPUT TAB(0,8)"Please enter the number of the first sector [0x08] [0x08] [0x08] [0x07] "G% 290 UNTIL G%>-1 AND G%<800 300 IF F%+G%>799 PRINT TAB(0,11)"Total exceeds 799, Re-enter details ": PRINT TAB(0,8)Q$:VDU7:GOTO 220 310 Track%=G% DIV 10 320 Sector%=G% MOD 10 330 : 340 FOR E%=1 TO F% 350 PROCrescue :REM see PROCrescue 360 Sector%=Sector%+1:IF Sector%>9 Sector%=0:Track%=Track%+1 370 NEXT 380 : 390 INPUT TAB(0,12)"Please enter new filename (7 characters maximum) :"name$ 400 CLS 410 PRINT''" *SAVE "name$" 3000 ";~B%;" 8023 1900" 420 PRINT''"File may now be saved by copying the above line by using the up-arrow key, the COPY key, and finally " 430 PRINT'"You may change to another drive before copying the '*SAVE' line if you wish." 440 PRINT'"If the file is not a BASIC program do not copy the last two groups (8023 1900)" 450 PRINT"(Additional copies of this file can be made by changing the drive and/or disk and recopying the '*SAVE' line)"'' 460 END 470 : 480 DEF PROCrescue :REM recover one sector from disk 490 ?block%=drive% 500 block%!1=B% :REM Address of destination in RAM 510 block%?5=3 :REM Number of command parameters 520 block%?6=&53 :REM 'Read' command byte 530 block%?7=Track% 540 block%?8=Sector% 550 block%?9=&21 :REM one block of 256 bytes 560 A%=&7F :REM Read/Write operation required 570 X%=block% MOD 256 :REM Tells disk controller- 580 Y%=block% DIV 256 :REM the address of block% 590 CALL&FFF1 :REM call disk operation 600 B%=B%+&100 :REM move up one page in RAM ready for next sector 610 ENDPROC 620 : 630 DEF PROCerror 640 CLOSE#0 650 REPORT:PRINT'" at line ";ERL 660 ENDPROC