• Please review our updated Terms and Rules here

DECUS Tape with DECUS C and other C compilers

cbscpe

Experienced Member
Joined
Apr 11, 2017
Messages
437
Location
Switzerland
I wanted to find out which C compiler was used to compile the RQDX3 source code, so I wanted to test this with DECUS C first, if possible with RT-11. However I could not find a place where I could download the DECUS tape described here

C Language System for RT-11 (Binary Version) Version: January 1982

Is there a place where you can download DECUS tapes. Or is there a place where I can download different C compilers for PDP-11? Either running under RT-11 or RSX if possible?

Cheers

Peter
 
One question, what is the fastest way to make a distribution tape/disk from the files on the this site?
 
Hi - I'm just curious as to what you have seen suggesting the RQDX firmware is compiled from C - rather than assembler?

DEC didn't release their own C compiler for the PDP-11 until about 1990 - 1991...
 
Hi - I'm just curious as to what you have seen suggesting the RQDX firmware is compiled from C - rather than assembler?

DEC didn't release their own C compiler for the PDP-11 until about 1990 - 1991...
Could be DECUS C, could be Whitesmith's C hosted elsewhere and then burned into the EPROMs, etc.
 
Hi - I'm just curious as to what you have seen suggesting the RQDX firmware is compiled from C - rather than assembler?

DEC didn't release their own C compiler for the PDP-11 until about 1990 - 1991...
I don't have a specific "smoking gun" to show you, but if you look at code generated by a human as opposed to code generated by a compiler *, you can sometimes see subtle ways that storage for local variables, as just one example, is allocated in a "frame" or on the stack that would suggest that the code was compiler generated. Pinning it down to a specific compiler or language would probably be a bit more difficult.

Still, it would probably be entertaining to try.

--------

* Back in the old days, you could tell the unix PDP11 C compiler to stop after generating the .s intermediate file, with the -s flag I think, and take a look at how it was converting C to assembler. Some more modern compilers have dropped that capability. Kind of a shame because I sometimes found it useful.
 
Radix said:
Hi - I'm just curious as to what you have seen suggesting the RQDX firmware is compiled from C - rather than assembler?
As Hunta also noted, the RQDX3 source code is available and written in C and PDP-11 MACRO.

It looks like an early C compiler.

There are no function prototypes at all, from what I can see, which I guess would rule out later compilers who get finicky about that sort of thing.

A tell-tale sign is that it requires a compiler with separate namespaces for struct tags (because it reuses tag names). My recollection is that the Whitesmiths C compiler did not have separate namespaces, neither did the early Unix C compilers. DECUSC has separate namespaces and was available post-1984 IIRC.

The package includes sources for printf and scanf, getc and putc. Getc and putc talk to a terminal directly (but not at 17756x).

The printf.mac code is clearly adapted from the DECUSC source code, or from a shared ancestor. It's streamlined, commented and the local symbols are renumbered, but the logic and data labels are the same. The comments are in exactly the same style as the RQDX3's other MACRO modules.

DECUS-C was substantially written by Martin Minnow, a DEC employee (either before or during its construction). A story I heard was that the DECUS-C compiler was based on the reverse-engineered Unix compiler object files. That was probably truer for the early stages of the compiler, if at all.

I recall a story from one of the RT-11 team leaders who told me, IIRC, that one of the team members had rewritten RT-11 KMON in C but the management didn't let the project go into production. So, that might be another sign that DECUS-C was in use. Perhaps they had an DEC-internal "fork" of the compiler.

The RQDX3 should have a good chance of compiling with DECUS-C, although the RT-11 version I acquired had bugs in it. I have an RT-11 DECUSC runtime kit (DCC.DSK) on GitHub with various bugfixes and some feature additions, including a hack that provides much more space during the parsing stage. If anyone wants to use it, let me know and I'll provide a README.TXT to help out with its usage. The compiler runtime library requires EIS, but I can add an emulator driver to the kit to handle that if EIS is missing.

https://github.com/rust11/rust/tree/master/kit dcc.dsk
 
Last edited:
A story I heard was that the DECUS-C compiler was based on the reverse-engineered Unix compiler object files.
It was originally done by Dave Conroy from the early V6 assembler C compiler around the time
when he was at the University of Waterloo. He told me the details decades ago, which I've forgotten.
I'd think the history would be around somewhere, but is all blurry after Martin took it over.
As you'd expect, it has all of the limitations of the V6 C compiler

The original compiler source is out there if you want to compare it to what is in the Macro-11 version

 
Code:
                                    NOTICE

The software contained herein, part code 2.2 crsx11, is proprietary to Whites-
miths, Ltd. and is copyright 1978, 1983, Whitesmiths, Ltd.   The  software  is
secured  against copying or listing.  ...
 
From Mark Williams Company (MWC) C distribution kit
Code:
                               ED
                    A Text Editor for RSX-11M

                        (Second Edition)

                               by

                         David G. Conroy

                 Last changed September 17, 1979
Code:
/*
 * C preprocessor.
 * When compiling, if any of MACHINE, LOCATION, or SYSTEM
 * needed to be changed, say something like `-DMACHINE="IBM370"'
 * to override the defaults.
 * The defined symbol `RSX' needs to be undefined for this
 * to run under Coherent.
 */
#include <stdio.h>

#define    streq(a,b)    (strcmp(a,b)==0)

#ifndef MACHINE
#define    MACHINE    "PDP11"
#endif

#ifndef LOCATION
#define    LOCATION "MW"
#endif

#ifndef    SYSTEM
#if RSX
#define    SYSTEM    "RSX"
#else
#define    SYSTEM    "COHERENT"
#endif
#endif
...
Code:
;
; AS
; ROOT SEGMENT
;
; VERSION X01
;
; DAVID G. CONROY    24-MAY-78
; LAST UPDATED:        11-JUN-79
;
...
 
Last edited:
Code:
    .TITLE    AS3D
    .IDENT    /X01/
 
    .NLIST    BEX
    .ENABL    LC
 
;
; AS
; CODE MANAGEMENT
;
; VERSION X01
;
; DAVID G. CONROY    02-NOV-77
; LAST UPDATED:        14-SEP-79
;            REPLACE CALL TO "$CAT5"
;
 
For those interested, in 2021 when Al Kosov first linked the RQDX source code in this forum I started to analyze the source code and starting from a disassembled RQDX3 ROM and started to assign the code to the individual source files, added labels and some comments. It's not perfect but it was my try to understand MSCP and how it is implemented on a microcontroller, as I still have the goal of building an MSCP controller for the Q-Bus using a simple microcontroller. Due to some other tasks the MSCP project stalled. The only thing I took from the RQDX source was the small real-time kernel which is written in MACRO-11 assembler and translated it to AVR assembler.
Attached is the last version of the disassembly. Perhaps from the C library code for cret$, csv$ and other routines for which I do not have lables in the section "File: C library routines" someone can tell which C compiler was used to generate the ROMs.
 

Attachments

Back
Top