W8SDZ@Simtel20.ARPA (04/09/84)
From: Keith Petersen <W8SDZ@Simtel20.ARPA> Sigi Kluger has written a new program which will take an existing .COM file and patch it with a specified .HEX file and then re-save the patched version. It's called MDMLNK and is available from SIMTEL20 in the MICRO:<CPM.MODEM7> directory. You'll find MDMLNK.COM/HEX/DOC there. Sorry I neglected to announce this very useful program. It allows MDM7xx users to patch in their overlays without using DDT. Here's a copy of the .DOC file. It's interesting reading. --Keith ---- DOC FOR MDMLNK v1.00 as of 03-26-84 MDMLNK is a utility for MDM7xx. It allows linking in the assembled overlay file without the use of DDT. This may be a bit more foolproof than the usuall DDT method. MDMLNK is self-prompting and will ignore all command line parameters. Upon entry, MDMLNK will ask for the INPUT file name. Enter the name of the uninstalled MDM7xx.COM file and be sure to specify the full file name. Next, you are asked for the HEX file name. Enter the full name of the assembled overlay file and be sure to include the .HEX suffix. Last, you will be asked for the OUTPUT filename. Enter the name of the installed MDM7xx file. Again, be sure to specify the full file name. MDMLNK will now first read the INPUT file, overlay it with the hex file, then write a temporary file which is finally renamed to the output file name. The temporary file is used so that the input file can be the same as the output file, yet a disk error will not wipe out the original. Errors will be reported for full directory, unable to write (disk full), file not found, and in case the hex file is corrupt. All errors will abort to CP/M, possibly leaving a file MDMLNK.$$$. MDMLNK not only works on any MDM7 file of any size (within reason), but it can also (BONUS!!!) be used with XMODEM or any other file which will be overlaid by a HEX file which does not change its size. -Sigi
W8SDZ@Simtel20.ARPA (04/09/84)
From: Keith Petersen <W8SDZ@Simtel20.ARPA> Thanks for the suggestion, Mat. I forwarded it to Info-Modem7 and Info-Cpm as I feel it will generate some interesting discussions. In the meantime, maybe it could be done easily by writing a submit file to be used with EX14.COM. EX14 allows console input from a file into programs which don't normally work under XSUB. It's available from SIMTEL20 in the MICRO:<CPM.SUBMIT> directory. --Keith
young@Uci-750a.ARPA (04/09/84)
From: Michal Young <young@Uci-750a.ARPA> An auto patcher sounds like a great idea. One feature I would like to see in it is verification of the code that was there before. Some lines near the beginning of a patch file would check the code to be replaced, version numbers, etc., and warn the user if things didn't look right. Related to this -- what do .com files look like, anyway? Is their format hidden somewhere in my CP/M manuals? --Michal
matt@UCLA-LOCUS.ARPA (04/09/84)
From: "Matthew J. Weinstein" <matt@UCLA-LOCUS.ARPA> Actually, if there's a standard relocatable format, with symbol table info, etc., that's probably a better thing to do patches on. Also, the way programs like SCCS and RCS do changes, they leave identifier strings in the binary, that can be searched for, and indicate version info about the program. No reason not to use this sort of approach, within reason... - Matt
ZZZ.RLK%MIT-OZ@MIT-MC.ARPA (04/09/84)
From: "Robert L. Krawitz" <ZZZ.RLK%MIT-OZ@MIT-MC.ARPA> In response to both your questios: 1) A .com file is simply a binary file containing a Z-80 (or 8080) machine-language program. It should cold start at 100H. 2) Yes, there is a standard relocatable format. It is not in the .com file, however. The hex file ("object" file produced by the assembler) is what you want. Original Intel hex format doesn't define the necessary extensions, but there is a standard extension. Unfortunately, I do not remembe the proper format, but I shall look it up. It is consistent with the Intel hex, and an Intel loader will load the program, without the relocating information. It is not difficult to patch -- I've done it before. As usual, what is required is that the jumps be re-calculated -- patching the hex file won't do that. If you don't have a hex file, patching something is difficult. Of course, you could write a program to recalculate jumps, but you have to be careful not to munge data. Robert