Hex2Bin- Compuserve Hex to Binary File Converter I originally wrote Hex2Bin so that I could read object files on Compuserve at a time when I didn't have any downloading capabilities. With a large enough capture buffer you can read CBTerm49.Bin and convert it into a useable form with Hex2Bin. When you read filename.BIN or filename.IMG on compuserve you will be looking at something a little like this: 1800000000801.... This Hexadecimal form of the file contains headers, and two hex bytes for every byte of the file. Therefor your capture buffer will need to be about two and a half times bigger than the actual object size of the file. You will also take significantly more connect time to read the file than you would need if you had Xmodem capabilities. The best use of this utility is to get a copy of CBTerm. CBTerm has Xmodem uploading and downloading capabilities. Chris Dos supports CBTerm version 4.5. CBTerm version 4.9 even allows you to Upload and Download over DataPac. Hex2Bin was written for use with the disk drive. You save the file you read into your capture buffer as a sequential file on disc. Hex2Bin then asks for the input filename- the name you saved it with, and the output filename- the name of the resulting object program you want to use. These names MUST be different. Hex2Bin reads and writes to the disk almost simultaneously- keeping two cahnnels open at the same time. Converting files to their object form in this method takes a considerable amount of time,but no save is needed when the program is done. Because Hex2Bin is very I/O bound compileing the program will not speed up the program with any significance, nor will removeing the Remarks, most of which never get executed. Hex2Bin lets you see the number of characters being written to the disk while it is running so that you can see that it is still busy. Hex2Bin.Seq is a textual form of this program. You can convert it to true Basic useing Txt2Bas- a short to type in Basic program to convert sequential Basic Programs to true Basic. When converting Hex2Bin to Basic respond N to the 'Upper Characters?' prompt in Txt2Bas. When Txt2Bas is finished the useable version of Hex2Bin will be in memory. To use Hex2Bin to read CBTerm you buffer will need about 30K of space. The terminal package I originally got with my Modem from Commodore- Teleterm/64 has sufficient space. Some Compuserve Binary files converted with this utility may appear with an invalid line number at the start. In that case change the setting in line 380 from header=0 to header=1 and re-run the conversion. This causes the program to strip an extra header checksum occasionally passed in the first block of data. Hex2Bin.Seq is the textual form of this program. Hex2Bin.Bin is the tokenized Basic form. Remove the 'Rem' in line 520 once you are confident about purgeing the destination file whenever you run this program. Tony Romer
Amiga7878