From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,1f0ed186713c1bdb X-Google-NewGroupId: yes X-Google-Thread: 1164f8,1f0ed186713c1bdb X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Sun, 12 Jun 2011 22:08:19 -0400 From: "Jerome H. Fine" Organization: Just Sufficient User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: alt.sys.pdp11,comp.sys.dec,vmsnet.pdp-11 Subject: Re: Source for RT-11 TECO V36 References: <4df2176d$0$312$14726298@news.sunsite.dk> <3ab4c070-9402-4749-8dc7-49310abd7f29@g28g2000yqa.googlegroups.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------000809080008070509000008" Message-ID: <4df570e2$0$315$14726298@news.sunsite.dk> NNTP-Posting-Host: 206.248.171.217 X-Trace: news.sunsite.dk DXC=:il8[l?:=PV[eoV[BRG`:]YSB=nbEKnk[JUTP3C6Ei7[PPfk^U[HX;_N1>V8bAJTI^3eOPKWXldeTQa4_jgFW[9_EFn_;5nRQhSoOJohnny Billquist wrote: >> Sounds plausible to me. >> >> In principle a suitable comparison tool comparing the two executables >> could show up areas of common content (blocks of common code/data?) as >> well as areas where the files are different. Afaik the standard DEC >> file comparison tools aren't usable this way, because they like to >> compare lines of text not binary files such as executables. Same for >> the standard UNIX file comparison tools. >> >> That doesn't mean there isn't a binary file comparison tool that uses >> something like the well documented "longest common subsequence" >> algorithm on words (or even bytes) though. In fact for reasons I won't >> go into here I had to write something along those lines to compare >> text files while ignoring line boundaries - I don't own the code, my >> employer does, so I couldn't post it here even if it was directly >> relevant, but the comparison core wasn't that difficult, someone with >> sufficient motivation and expertise (and time) could do something >> similar. >> >> Interesting challenge. > > > Another potential problem is that the same source might yield > different executables because they are linked with system libraries, > and those libraries might have changed. I doubt that this is a problem in this case. TECO.SAV does not seem to use any subroutines from the SYSLIB.OBJ file. > Comparing binary files is difficult because of the fact that binary > files might be so many different things. For an executable for > example, it might make more sense to report differences as related to > load locations, and not file locations. But that requires > understanding both the binary load format, and also understand overlay > structures. And what if a difference is merely that the data is the > same, but loaded at a slightly different address? That would mean all > data are different, if you just look at the address, but in fact it's > all the same except for the location. A big problem. > And you can easily come of with a whole number of different > problems/schemes/issues with other binary files. So there is no > general meaningful binary file comparison. You need one tool for each > type of file and type of comparison you want to do. > Text file comparison is actually just another special case of binary > file comparison, for one specific type of binary files, and one > specific type of comparisons. While binary (or executable) files usually have references to other locations in the file either as an absolute address or as a difference (between the current location and the other location), the most I have ever seen a text file reference is a label (by name) in another part of the file. For purposes of comparison, this would probably never matter. In addition, text files are usually compared line by line. Since the line delimiter is always (at least in my experience) non-ASCII text, it is rather simple for a program to isolate each separate line independently of content and length. So while a text file may be a special case, the restrictions on the individual characters which may be used allow individual lines of text to be isolated - which can not be done for a binary file which has no restrictions on the date information. Jerome Fine --------------000809080008070509000008 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit >Johnny Billquist wrote:
Sounds plausible to me.

In principle a suitable comparison tool comparing the two executables
could show up areas of common content (blocks of common code/data?) as
well as areas where the files are different. Afaik the standard DEC
file comparison tools aren't usable this way, because they like to
compare lines of text not binary files such as executables. Same for
the standard UNIX file comparison tools.

That doesn't mean there isn't a binary file comparison tool that uses
something like the well documented "longest common subsequence"
algorithm on words (or even bytes) though. In fact for reasons I won't
go into here I had to write something along those lines to compare
text files while ignoring line boundaries - I don't own the code, my
employer does, so I couldn't post it here even if it was directly
relevant, but the comparison core wasn't that difficult, someone with
sufficient motivation and expertise (and time) could do something
similar.

Interesting challenge.

Another potential problem is that the same source might yield different executables because they are linked with system libraries, and those libraries might have changed.
I doubt that this is a problem in this case.  TECO.SAV does
not seem to use any subroutines from the SYSLIB.OBJ file.
Comparing binary files is difficult because of the fact that binary files might be so many different things. For an executable for example, it might make more sense to report differences as related to load locations, and not file locations. But that requires understanding both the binary load format, and also understand overlay structures. And what if a difference is merely that the data is the same, but loaded at a slightly different address? That would mean all data are different, if you just look at the address, but in fact it's all the same except for the location.
A big problem.
And you can easily come of with a whole number of different problems/schemes/issues with other binary files. So there is no general meaningful binary file comparison. You need one tool for each type of file and type of comparison you want to do.
Text file comparison is actually just another special case of binary file comparison, for one specific type of binary files, and one specific type of comparisons.
While binary (or executable) files usually have references
to other locations in the file either as an absolute address
or as a difference (between the current location and the
other location), the most I have ever seen a text file reference
is a label (by name) in another part of the file.  For purposes
of comparison, this would probably never matter.  In addition,
text files are usually compared line by line.  Since the line
delimiter is always (at least in my experience) non-ASCII
text, it is rather simple for a program to isolate each separate
line independently of content and length.  So while a text
file may be a special case, the restrictions on the individual
characters which may be used allow individual lines of text
to be isolated - which can not be done for a binary file which
has no restrictions on the date information.

Jerome Fine
--------------000809080008070509000008--