RECOV2.BA by Phil Wheeler, edited by Robert Benson (10/30/89) RECOV2.BA is a Model 100/102 program that lets the user explore the files on a damaged disk and recover text (.DO) files. This can even be done on a disk that has been rendered unreadable do to a missing directory sector. This program uses the sector access mode of the TDD2 via FLOPPY(2), it will work with the drive (TDD2 only) and will recover text (.DO) files from both TDD1 and TDD2 disks. FLOPPY(1) has no such capability so this program will not work with the TDD1, use POWR-DOS or TS-RANDOM for it. To use RECOV2.BA load FLOPPY(2) before running, it is a good idea to clear everything else off the menu but RECOV2.BA and FLOPPY(2) making the largest possible space available. If you know the file you want is small make sure you have that much memory available plus 2-3K bytes. 1. Menu Functions: When you enter RECOV2.BA you will see a menu of six options, you are in the "Recover menu" mode, press whenever you want to return to this mode. Press a letter key (upper or lower case) to select one of the six options: S)elect New Start Sector -- this is the first thing that you must do when you enter the program (range: TDD2 disk is 0 - 159; TDD1 disk is 0 - 79). If you go above the limit for a TDD1 disk you get a "Sector Unreadable" message. G)o to Next Sector on Disk -- takes you to the next sector on a disk after using to return to the Recover menu. R)ecover DO file at this Sector -- starts the recovery process begining at the sector that was just displayed, you will be prompted for a file name (no extension is needed). A)ppend to Recover File -- will let you add a new sector of text to a file already started with the R)ecover function. L)ink Next Sector Automatically -- takes you to the next sector in the file being recovered, may or may not have the same effect as the "G" function. A beep and re-display of the menu means that the last sector was reached, or that the operation is otherwise invalid. E)xit -- exits to the Model 100/102 menu. 2. Typical Operation: RECOV2.BA is strictly a reading program, it will not modify bytes on the disk (if you want to do that use SECTOR.BA). RECOV2 displays the first 48 bytes of a sector, letting you move quickly through the disk and find the beginning of text (.DO) files. Put a disk (TDD1 or TDD2) in the drive (TDD2 only) and run RECOV2.BA, use the "S" function to select Sector 0 to start. If this sector is unreadable the program will tell you so. If it's a TDD2 disk press "G" to repeat the process for Sector 1 (TDD2 disks have two directory sectors). To recover lost files select the first possible data sector, 1 for a TDD1, 2 for a TDD2. You will get a display of the first 48 bytes in the sector. Do they look like text, no graphic characters in the ASCII representation at the right of the screen (except in the second byte)? Is it a file you want? If both answers are yes; press to return to the Recover menu and use the "R" function to begin the recovery procedure starting with the sector that you just examined. The "R" function will prompt you for a file name (no extension is needed). After entering a file name a "Writing" message will flash and you will be returned to the Recover menu, a beep at this point means that there is not enough memory to save the recovered file, clear some and start over. Use the "L" function to find and display the next sector in the file, if it looks ok press to return to the Recover menu and use the "A" function to append that sector to the recovery file. Eventually you will get to the last sector in the file and if you try to use "L" again you will get a beep and return to the Recover menu. Note that the "G" function lets you go beyond the end of a file so that you may look for the begining of the next one. 3. Technical Notes: This version has been sped up substantially over the first RECOV.BA by the use of a machine language subroutine, loaded unobtusively in the alternate LCD buffer area. The first four bytes you see in the file display mode is the sector header, byte 1 (at 0000) is 16h on a TDD2 disk, and 00h on a TDD1 disk. You cannot change this byte and trick the drive with SECTOR.BA for it is written every time the sector is. The second byte is FFh if it's the last sector in the file (or a directory sector), and 00h if the sector is not used. The next two bytes are unallocated and always zeros in my experience. You probably will find garbage at the end of a recovered file, stuff left over from an old file in the last sector. An EOF (1Ah) is not written to the disk as the TDD2 uses file length data from the directory sector which may not be available. Just edit out the junk with TEXT before saving the file to disk again. Hopefully some hardy programmer will extend this program to grab BA and CO files from an unreadable disk.