[TUHS] Sources for an old Optimizer available?

Oliver Lehmann via TUHS tuhs at tuhs.org
Fri Nov 20 01:44:16 AEST 2026


Hi,

I'm currently reconstructing C-, ASM-, PLZ/ASM- and PLZ/SYS Sources
of an early version of ZEUS which the communist part of germany got
into their hands around end of 1983 and relabled it to WEGA.

I started this project over 20 years ago (completed all kernel sources,
libc and some easier binars by hand). I put this project aside due to....
well I got two kids ;)

With the help of AI I'm currently working on this project again and I
made huge progess, got The complete C-Compiler chain (cpp, cparse,
codgen, popt), all libs and plenty of binaries already 100% byte identical
restored (C sources).

The hardest part is, that many parts of the system where compiled with
different (unavailable) stages/versions of the C-Compiler passes. So the
AI has to make assumptions how the codgen, cparse and popt could have
looked like to get the exact same object from the C source which just
can't reproduced with the shipped C compiler. More than once it was
revealed that striving for 100% byte compatiblity is the way to go because
some code only works because the compiler delivers a specific ASM
(meaning, sometimes some registers contain values only by luck - but
the whole program relies on it)

Long story short - I am currently working on a so called "global optimizer".

The cc manpage lists two optimizers:

      *-Ol*     Invoke the C global optimizer to apply loop optimization.

      *-Or*     Invoke the C global optimizer to apply loop optimization and
              register allocation.

      *-O*      Invoke the C peephole optimizer for Z8000 code.


While restoring the popt was easy, the gopt binary is nearly 6 times 
it's size.
The AI is progressing in restoring it but I guess this will be a longer 
process
until the 100% byte identical mark is reached.

I searched SYSIII, SYSV, BSD but I found no available sources of something
called "global optimizer". So I was wondering - does someone know if there
are sources somewhere hidden I could use to kinda start with? Because  the
binary is too big to fit into one segment of the adressable space of a Z8001
multiple objects where built and linked to reside in different segments. A
uniq-made list of sources the SCCS tags reveal are:




/lib$ strings gopt | grep '@\[' | sort -n | uniq
@[$]alias2.c    1.3  08/30/82 17:11:29 Copr. 1981 87wega3.2.
@[$]alias2.c    1.5  02/07/83 15:50:16 Copr. 1981 87wega3.2.
@[$]beta2.c    1.5  01/07/83 13:38:14 Copr. 1981 87wega3.2.
@[$]comm2.c    1.1  07/07/82 15:54:49 Copr. 1981 87wega3.2.
@[$]common    2.4  03/04/83 15:24:28 Copr. 1981 87wega3.2.
@[$]debug2.c    1.3  02/07/83 15:51:07 Copr. 1981 87wega3.2.
@[$]dom2.c    1.2  01/07/83 13:38:58 Copr. 1981 87wega3.2.
@[$]ebbo2.c    1.8  03/04/83 15:54:14 Copr. 1981 87wega3.2.
@[$]flow2.c    1.6  03/04/83 15:55:39 Copr. 1981 87wega3.2.
@[$]init2.c    1.3  02/07/83 15:53:16 Copr. 1981 87wega3.2.
@[$]live2.c    1.9  01/07/83 13:42:01 Copr. 1981 87wega3.2.
@[$]lpind2.c    1.5  02/07/83 15:54:28 Copr. 1981 87wega3.2.
@[$]lpinv2.c    1.10  03/04/83 15:58:16 Copr. 1981 87wega3.2.
@[$]mfile2.h    1.7  03/04/83 16:06:50 Copr. 1981 87wega3.2.
@[$]quads2.c    1.8  03/04/83 16:00:29 Copr. 1981 87wega3.2.
@[$]rdr    2.4  03/04/83 15:31:15 Copr. 1981 87wega3.2.
@[$]rdr2.c    1.3  03/04/83 16:01:05 Copr. 1981 87wega3.2.
@[$]reader2.c    1.5  03/04/83 16:01:42 Copr. 1981 87wega3.2.
@[$]reg2.c    1.11  03/04/83 16:04:05 Copr. 1981 87wega3.2.
@[$]wrtil2.c    1.7  03/04/83 16:06:00 Copr. 1981 87wega3.2.

The same "gopt" was shipped with ZEUS 3.21 - but ofc not with the 
hex-edited copyright strings.

Any hints are welcome the ease the pain of my AI ;)

Best regards,
Oliver



More information about the TUHS mailing list