0010 ^ma8 73 ^ju 0020 THE HP-41<=>HP-71/75 "PACK" BUGS by Michael Markov 0030 ^sk0 P.O. Box 17, Lockwood, New York 14850 USA 0040 ^sk1 If you pack mass storage media with the HP-71/75 "PACK" functions, you have just armed 0050 a booby trap that could be set-off the next time you add a file with your HP-41. Your 0060 storing additional files on the medium could trash some of your existing files, or you may 0070 get the "medium~full" error message. 0080 When this happens, restoring the medium / recovering files will NOT be fun! 0090 ^sk1 The bug strikes because "PACK" and "PACKDIR" do NOT "erase" old directory entries. 0100Instead, copies of the entries (with the file start addresses adjusted as required) 0110 are stored nearer the start of the directory, filing the space previously used by purged 0120 files. 0130 Then, every byte of the entry following the last relocated directory entry is reset to a 0140 value of 255 (hex FF). I call this entry the "End~Of~Directory" marker. 0150 Following this marker, you will usually find a number of invalid / duplicate directory 0160 entries. 0170 ^sk1 This implementation works nicely with HP-71 & HP-75 computers, 0180because the respective "COPY" commands effectively move the "end~of~directory" marker 0190 as required to safeguard the integrity of your directory. However, when 0200 you add an HP-41 file with mass storage functions from the HP-82160A HP-IL 0210 interface, the end of directory marker is NOT moved -- it is overwriten. 0220 The invalid / duplicate entries which were hidden by the "end~of~directory" marker 0230 become part of the directory, and 0240 you subsequently can encounter a variety of nasty problems. 0250 ^sk1 The best way to avoid this problem is to never pack mass storage media. However, 0251 the time may well come when you have no other solution. Then, the "RESETDIR" program 0255 should be used to reset all directory entries after the end 0260 of directory marker to hex FF. Be sure you give your battery pack a chance to recharge 0270before using "RESETDIR". 0280 ^sk1 WARNING: 0290 Packing mass storage media is a "Last Resort" measure that should be used only when 0300 you really have no other choice. 0310 Wear on the drive and on the medium is one of the most inportant reasons why you should 0320 NOT pack mass storage media. There are several other important considerations: 0330 ^sk1 A. HP-75 "PACK" problems: 0340 ^sk0 ~1. Packing a cassette may require anywhere from a few minutes 0350 to an hour, depending on the number and lengths of the files on the medium. Anything that 0360 interrupts the pack operation (including power failure) will make the medium invalid -- 0370 part or all of your valuable information is lost. Also, reading files from a medium after 0380 an invalid pack error is a chancy business that often leads to "Memory Lost". 0390^sk0 ~2. If your battery pack is NOT fully charged, you will probably get an "invalid pack" 0400 error -- even if the charger is plugged-in. 0410 ^sk0 ~3. A fully charged HP88014A battery pack (for the HP-9114 drive) is good for only 0420 40 minutes of read / write operations. 0430 The shorter SEEK time speeds up the pack operation considerably, but I have crashed a disc 0440 with approximatelly 400K bytes of data when I tried to pack it. 0450 ^sk1 B. HP-71 "PACK" and "PACKDIR" problems: 0460 ^sk0 Since the HP-71 has a higher 0470 sustained data transfer rate than the HP-75, you will find that the power consumption of 0480 the HP9114 drive is less significant -- provided you 0490 start with a fully charged battery pack! 0500 However, this does NOT guarantee available power is adequate. 0510 ^sk1 Getting along without "PACK": 0520 ^sk0 Effectively, the bugs mean that once you have packed a medium, you should NOT 0530 add ANY new 0540 HP-41 files, using the HP82160A interface. (But you can transfer HP-41 files from another 0550 drive with the HP-75 COPY command). 0560 I have found that the best way to avoid trouble is to segregate HP-41 files 0570 on cassettes I use for no other purpose. I mix HP-41 files with HP-71/75 files ONLY on 0580 archival (backup) media that are intended for "read~only" use. 0590 ^sk1 Since most HP-41 files normally use only one or two sectors (256 byte each), 0600 the file you purge will usually be replaced by a file of comparable length. 0610 This means that the amount of unsuable mass storage capacity is negligible -- 0620 you should not need to pack your HP-41 media. 0630 ^sk1 Larger HP-41 files (Write All, DAta and the occasional long program) 0640 should never be purged, since the next file you store (possibly a tiny key assignment 0641 file) could then tie-up the storage capacity reserved for the larger file. Instead, you 0642 should keep the file for the next time you will need a large file of like size. 0643 ^sk1 In general, I find that using temporary "work" media is very convenient. These media 0644 are never packed. Instead, when I run into "end~of~medium", I copy the few files I want 0645 saved onto other "work" media, and re-initialize. This minimizes wear on both the drive 0646 and on the storage media. 0650 ^sk0 HAPPY PROGRAMMING!