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-Thread: ffc31,1f0ed186713c1bdb X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,gidf4c4f7386e,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Date: Sun, 12 Jun 2011 22:07:04 -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: <3ab4c070-9402-4749-8dc7-49310abd7f29@g28g2000yqa.googlegroups.com> Content-Type: multipart/alternative; boundary="------------090303020607090900050909" Message-ID: <4df57096$0$315$14726298@news.sunsite.dk> NNTP-Posting-Host: 206.248.171.217 X-Trace: news.sunsite.dk DXC=@DGTFnnlj[\bD]FUj;YcCZYSB=nbEKnk[JUTP3C6Ei7[PPfk^U[HX;_N1>V8bAJTI^3eOPKWXldeTQa4_jgFW[9_EFn_;5nRQhSoOJohn Wallace wrote: >>On Jun 11, 11:20 am, glen herrmannsfeldt wrote: > > >>>In vmsnet.pdp-11 Jerome H. Fine wrote: >> >>>About a year ago, I found some source code for >>>TECO V36 which assembles to V36 when asked >>>via "EO=", but the TECO.SAV file is significantly >>>different from the version released with V04.00 of >>>RT-11 in 1980. The version based on the source >>>code that I found is 51 blocks long and it uses more >>>memory. The version from RT-11 V04.00 is just >>>50 blocks long and has a much smaller root section. >>>Probably most of the code is the same, just that >>>some of the code that is in the root of the version >>>for which I have the source has been moved to an >>>overlay. >>> >>> >>I haven't thought about this for a while, but for an >>overlay isn't the source the same, but changes to the >>LINK command change the overlay, and so the SAV file? >> >>Or by source do you also mean the LINK command needed? >> By source code, I mean the MACRO-11 code commented source files which are first assembled using MACRO.SAV, then linked using LINK.SAV to produce the TECO.SAV file. LINK.SAV does have a command file as well which specifies which OBJ file is used for the root and which overlay segment. Except for the OBJ file for OHANDL.OBJ which is used for the overlay code, it seems very unlikely based on the PSect list that any subroutines from SYSLIB.OBJ were used. >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. > VERY!!!!!!!!!!!!!!!!!!!!!!!!!!!! While ASCII text files that have changes made to a small number of lines can very easily be compared, I suspect that it would be necessary to disassemble an executable program to achieve something close to the same result. Out of interest, I did this about 10 years ago to a very short program of about 1000 words of code and data. There were 6 versions for the program which by then had seen many previous versions and had become reasonably stable. I added additional conditional assembly code which allowed me to use one source file to produce all six SAV files depending on which version I wanted. Unfortunately, the original comments were still not available, so some of the details are not clearly understood. The key difficulty for RT-11 (and maybe for the other PDP-11 operating systems) is that most of the time the code and the data are often mixed. Thus data areas which differ by even one word will pose an immense problem without a disassembly. Even with a disassembly, location labels which are not GLOBALs will no longer be the same name. My solution for making changes to the SAV files in RT-11 which have a small number of changes is to first modify the source code so that the mismatches in the number of words are eliminated. This condition is easy to locate since prior to any such mismatch, only offsets to locations higher than the mismatch appear in isolated locations. After the mismatch, almost every word in the two SAV files differ. Once the mismatches due to the incorrect number of words have been fixed, the actual differences in the code and date can be fixed. However, this is a very labour intensive manual procedure and can sometimes take more than an hour per size mismatch plus additional time at the end to correct any remaining differences, especially is the code was written in a high level language. Consequently, I would undertake such a project only when it is absolutely required. I know that I have not really answered your question. My conclusion is that such a comparison is reasonable only for ASCII text files OR executables where a few isolated changes have been made and the source code is available to be modified, i.e. the source code is available (or can be provided) for one version and a second close version also needs the source code. Jerome Fine --------------090303020607090900050909 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit >John Wallace wrote:
>On Jun 11, 11:20 am, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
  
>In vmsnet.pdp-11 Jerome H. Fine <every...@nospam.com> wrote:
About a year ago, I found some source code for
TECO V36 which assembles to V36 when asked
via "EO=", but the TECO.SAV file is significantly
different from the version released with V04.00 of
RT-11 in 1980.  The version based on the source
code that I found is 51 blocks long and it uses more
memory.  The version from RT-11 V04.00 is just
50 blocks long and has a much smaller root section.
Probably most of the code is the same, just that
some of the code that is in the root of the version
for which I have the source has been moved to an
overlay.
      
I haven't thought about this for a while, but for an
overlay isn't the source the same, but changes to the
LINK command change the overlay, and so the SAV file?

Or by source do you also mean the LINK command needed?
By source code, I mean the MACRO-11 code commented source
files which are first assembled using MACRO.SAV, then linked using
LINK.SAV to produce the TECO.SAV file.

LINK.SAV does have a command file as well which specifies which
OBJ file is used for the root and which overlay segment.  Except for
the OBJ file for OHANDL.OBJ which is used for the overlay code,
it seems very unlikely based on the PSect list that any subroutines
from SYSLIB.OBJ were used.
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.
VERY!!!!!!!!!!!!!!!!!!!!!!!!!!!!

While ASCII text files that have changes made to a small
number of lines can very easily be compared, I suspect that
it would be necessary to disassemble an executable program
to achieve something close to the same result.  Out of interest,
I did this about 10 years ago to a very short program of about
1000 words of code and data.  There were 6 versions for the
program which by then had seen many previous versions and
had become reasonably stable.  I added additional conditional
assembly code which allowed me to use one source file to
produce all six SAV files depending on which version I wanted.
Unfortunately, the original comments were still not available,
so some of the details are not clearly understood.

The key difficulty for RT-11 (and maybe for the other PDP-11
operating systems) is that most of the time the code and the data
are often mixed.  Thus data areas which differ by even one word
will pose an immense problem without a disassembly.  Even with
a disassembly, location labels which are not GLOBALs will no
longer be the same name.

My solution for making changes to the SAV files in RT-11 which
have a small number of changes is to first modify the source code
so that the mismatches in the number of words are eliminated.
This condition is easy to locate since prior to any such mismatch,
only offsets to locations higher than the mismatch appear in
isolated locations.  After the mismatch, almost every word in the
two SAV files differ.  Once the mismatches due to the incorrect
number of words have been fixed, the actual differences in the
code and date can be fixed.  However, this is a very labour
intensive manual procedure and can sometimes take more than
an hour per size mismatch plus additional time at the end to
correct any remaining differences, especially is the code was
written in a high level language.  Consequently, I would undertake
such a project only when it is absolutely required.

I know that I have not really answered your question.  My conclusion
is that such a comparison is reasonable only for ASCII text files
OR executables where a few isolated changes have been made and
the source code is available to be modified, i.e. the source code is
available (or can be provided) for one version and a second close
version also needs the source code.

Jerome Fine
--------------090303020607090900050909--