MOVHEX.DOC 29 Mar 85 Page 1 Copyright 1984-5 Michael M Rubenstein Note: The compiled version requires a Z80 to run. Description. This is a corrected version of the program MOVHEX which was distributed with BIOSMMR. MOVHEX changes the load location of a HEX file (produced by various assemblers). It is NOT a relocator -- only the load address is changed. This can be useful when assembling a BIOS or a CCP replacement (e.g. ZCPR) to combine it with PUTSYS (or SYSGEN). For example, on my (Kaypro 10) system, PUTSYS requires the CCP image to start at location 0980h. ZCPR3 can be assembled ORGed to the proper address and a HEX file produced. The command movhex 980 zcpr3 changes ZCPR3.HEX so that it will load at 0980h. It can then be integrated with PUTSYS.COM with the command mload putsys.com,zcpr3 The syntax of MOVHEX is movhex [ []] If no file is specified, input comes from "stdin" (normally the console, but Unix style redirection is permitted) adn output goes to "stdout" (also normally the console). This is a very unusual way to use MOVHEX -- don't worry if you can't see why anyone would want it to work this way. More commonly, a single file name is specified. If no file type is given, HEX is assumed. The same file name will be used for input and output. The original file will not be deleted until the new file is completed. If two file names are given (HEX is the default file type for both), the first will be used for input, the second for output. Modifying MOVHEX. MOVHEX is written in a fairly standard dialect of C. A few notes for those wishing to compile it themselves: - The #define statements before the #include are used by my system to set the buffer size for disk I/O and the name of the program. Just delete them for most compilers. - fopen (and copen) are used to supply the file name from MOVHEX.DOC 29 Mar 85 Page 2 several sources. Most systems should just use fopen, but be careful. My system permits an output file to have the same name as an input file. Most systems will choke on this. Some modification of the file opening logic will certainly be necessary.