HEXFER.200 by James Yi, edited by Robert Benson HEXFER is a machine language utility that saves a CO program to a text file in hexadecimal format for ASCII file transfer. After running HEXFER.BA, choose (1) from the menu of HEXFER.CO to load a CO program saved in hexadecimal format. Enter the name of the text file with or without an extension or just press [ENTER] to quit and retrun to the menu. After entering the text file name you can choose to relocate the CO program (if it is relocatable) by entering the new address or just press [ENTER] to load it at its original location. Choosing (2) saves a CO program to a text file in hexadecimal format, enter the name of the CO program first or press [ENTER] to abort the process and return to the menu. Next enter the name of the text file that the data will be saved to, you can specify an output device with the file name like CAS: or RAM: or LPT: The following is for those interested in uploading CO programs in hexadecimal format and want to make them relocatable: If a CO program will not work when relocated it can be made to work by making some adjustments to the text file. First you need to find out which bytes in the program should be relocated, all opcodes with 2-byte operands that point to a location within the program are automatically relocated, but items in tables or vectors are not. To relocate these find the address (I'll call them relocating data) of each item in its original location then insert the data in Hex format (low byte first) at the end of the existing text file. Example; if an item is at $EA60 in its original location, insert 60EA at the end of the text file, when HEXFER is run it will relocate the two bytes at $EA60. Be careful when relocating items this way! Avoid twice relocating an item if it is preceding with a 3-byte opcode and is self-adjusting, this can be determined by examining a disassembly of the CO program. If bytes are self-adjusting and should not be relocated (I'll call these non-relocating data) add the original addresses (low byte first) at the end of the existing text file as was done for the relocating data. If HEXFER comes upon two bytes at $EA88 and recognizes it as an operand of a 3-byte instruction, it will first check to see if it is "ok" to relocate $EA88 by reading the next number at the end of the text file, if that number is 88EA and therefore matches the address of bytes it is about to relocate it will just skip $EA88 and not relocate it. The one convention that must be followed is the order of adding "non-relocating" data (if any) at the end of a DO file, it must come before any "relocating data" and has to be in ascending order, "relocating data" however needs no order as long as it is last.