> From: "Nelson H. F. Beebe"
> there is a nice compact history of the PDP-11 and early Unix at this
> new article:
Not a bad artcle, but it had a number of minor errors, which I found irritating.
They should have gotten an expert to proof it.
Here are some:
registers could access any other register - as well as memory or direct
data - using one of the six different addressing modes
I think 'instruction' may have been meant for the first "register"; as
written it makes on sense. (Unlike the PDP-10, in the PDP-11, a register
can't address another register.) Oh, and there are eight addressing modes.
use of labels instead of hard-coded addresses makes it easier to
program and makes the code relocatable in memory
I'm not sure whether the writer knows the difference between 'PC-relative
addressing' (a PDP-11 feature; code that will run at any address, without
_any_ changes to the binary) and 'relocatable binary (which uses labels, as he
describes). - but is not PDP-11 specific.
The program counter can be accessed like any of the other registers ... The
program counter is intended to support jump, branching, and other control
flow instructions.
Uh, no. It's not clear _exactly_ what was meant here, but... having the PC as
a general register is for PC-relative addressing of operands, immediate data,
and absolute addressing of operands. Jumps, branches, etc don't use the fact
that the PC is a general register.
These are the key advantages of assembly programming over high-level
languages - assembler code always runs faster and uses less memory.
Not really, with modern compilers.
The number above represents -2.
A commenter caught this one.
Just use a $ to represent a decimal number
In UNIX assembler, "$" means 'immediate data'; a trailing
"." means decimal.
And a tip of the hatly hat for getting this:
Although the ++ and - operators in C are equivalents of DEC and INC
instructions, they were inspired by an addressing mode in the PDP-7.
right.
Noel
Although the story is well known to members of this list, there is a nice
compact history of the PDP-11 and early Unix at this new article:
A brief tour of the PDP-11, the most influential minicomputer of all time
https://arstechnica.com/gadgets/2022/03/a-brief-tour-of-the-pdp-11-the-most…
It describes PDP-11 assembly language, and shows the booting of a Unix
system on a simh instance. It also includes the famous picture of
Dennis and Ken at a PDP-11 console, and concludes with a link to an
online text of a book about PDP-11 assembly language programming.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: beebe(a)math.utah.edu -
- 155 S 1400 E RM 233 beebe(a)acm.org beebe(a)computer.org -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------
I am reading some UNIX text processing books and am interested in the
lineage of Documenter's Workbench.
I see documentation of 1.0 (i.e
https://archive.org/details/sysv-dwb/page/n5/mode/2up)
I see a copy of 2.0 for 3B2 (i.e.
https://archives.loomcom.com/3b2/software/Documenters_Workbench/)
>From there things get a little less clear, it seems like we jump to
3.2 with SysVR3.2?
Then there is a 3.3 version https://github.com/n-t-roff/DWB3.3
One of my books from the late 80s references 3.4 available as a source
code purchase independent of UNIX.
Then it appears SGI might have had a 4.x strain? (i.e.
https://archive.org/details/sgi_Documenters_Workbench_4.1.3)
Heirloom is derived from OpenSolaris which is derived from?
Can anyone firm this lineage up a bit; and is 4.x an SGI thing or what
(I extracted the image, the relnotes inside might as well not exist).
Regards,
Kevin
> On Mar 12, 2022, at 2:02 PM, Rob Pike <r(a)golang.org> wrote:
>
> Indeed. Be careful about the code Numerical Recipes if you are doing
> important numerical work.
> For simple stuff it's fine, of course, but floating point is a
> minefield that requires expert navigation.
>
> -rob
That's the seductive trap of floating-point numbers, isn't it? They invite us to think about them as if they were the real numbers, but they are very, very much *not* the real numbers. And yet, most of the time, for most applications, if you treat them as if they were, you get plausible results.
Adam
Hello,
I'm trying to understand a quirk in 32-bit x86 code generation conventions:
on Linux, when returning a structure from a function by value:
struct S {
int i, j;
};
struct S f(int x)
{
return (struct S){x, sizeof(void*)};
}
the caller reserves space for the returned structure and passes a pointer
to that space as an 'invisible' extra argument, which is prepended to
the argument list; the callee returns this pointer (although the caller
knows it anyway); it's as if the function is transformed to
struct S *f(struct S *ret, int x)
{
ret->i = x;
ret->j = sizeof(void*);
return ret;
}
with one essential difference: the function 'f' itself is responsible for
popping the extra argument off the stack (the 'x' argument is popped by
its caller).
This necessitates using the return-with-immediate ('ret 4') instruction
instead of the normal 'ret'; this is the only instance where this variant of
the 'ret' instruction is used in code generation for C programs on Linux
normally.
I wonder how this exception came to be.
Early versions of GCC (e.g. gcc-1.27) did not implement this convention, i.e.
the caller was responsible for popping the invisible pointer similar to the
normal arguments. The "callee-pops" variant was implemented later for
"compatibility with other compilers", and the option that controls this is
called -fpcc-struct-return, which also disables returning small structures in
registers (in the example above GCC would return the value in EDX:EAX register
pair).
Operating systems differ on following this convention. For example, FreeBSD
and OpenBSD do not, and neither does Windows.
Looking at 386BSD tree in unix-history-repo, I see that it used GCC, not PCC.
Where can I look at the history of x86 code generation development in PCC?
Do I understand correctly that i386 code generation in PCC evolved in parallel
with GCC, and at some point GCC was convinced to adopt the (less efficient)
PCC calling convention by default?
Did PCC prefer to do this stack adjustment for the invisible pointer on the
callee side for some other platform, and the behavior was merely carried over
to the i386 port?
Thank you.
Alexander
> The Documenter's Workbench is sort of the unsung hero
> of Unix. It is why Unix exists, Unix was done to write patents and
> troff and the Documenter's Workbench was all about that.
My response along the following lines seems to have gone astray.
The prime reason for Unix was the desire of Ken, Dennis, and Joe
Ossanna to have a pleasant environment for software development.
The fig leaf that got the nod from Multics-burned management was
that an early use would be to develop a "stand-alone" word-processing
system for use in typing pools and secretarial offices. Perhaps they
had in mind "dedicated", as distinct from "stand-alone"; that's
what eventuated in various cases, most notably in the legal/patent
department and in the AT&T CEO's office.
Both those systems were targets of opportunity, not foreseen from the
start. When Unix was up and running on the PDP-11, Joe got wind of
the legal department having installed a commercial word processor.
He went to pitch Unix as an alternative and clinched a trial by
promising to make roff able to number lines by tomorrow in order to
fulfill a patent-office requirement that the commercial system did
not support.
Modems were installed so legal-department secretaries could try the
Research machine. They liked it and Joe's superb customer service.
Soon the legal department got a system of their own. Joe went on to
create nroff and troff. Document preparation became a widespread use
of Unix, but no stand-alone word-processing system was ever undertaken.
Doug
Decades ago (mid 1993) I produced a CD-ROM with free software for
Novell's UnixWare entitled "Applications for UnixWare". This was at
Novell's request, and they distributed the CDs at trade shows.
There's nothing very special in the CD, but I recently received a
request for it, so I put it up with a minimal description at
http://www.lemis.com/grog/Software/Applications-for-UnixWare.php
Feel free to copy it (with attribution).
Greg
--
Sent from my desktop computer.
Finger grog(a)lemis.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php
All, I've just placed this document at
https://www.tuhs.org/Archive/Documentation/TechReports/Baker_Struct/bsbstru…
Many thanks to Doug for passing it on!
Cheers, Warren
----- Forwarded message from Douglas McIlroy -----
Warren,
Someone asked if Brenda Baker's original technical memorandum about
struct is available. I scanned my copy and passed it on, secure in my
belief that the Labs won't care since it is essentially the same as
her journal publication.
For the memo to be genuinely available, I'd like to send it to TUHS.
With that in mind I redacted information about corporate organization
and distribution channels. However the memo still bears the AT&T logo
and the words "not for publication".
Doug
----- End forwarded message -----
Thanks to Doug and Warren for getting Brenda Baker's memo on struct
online at
https://www.tuhs.org/Archive/Documentation/TechReports/Baker_Struct/bsbstru…
She later published a formal article about that work in
An Algorithm for Structuring Flowgraphs
Journal of the Association for Computing Machinery 24(1) 98--120 January 1977
https://doi.org/10.1145/321992.321999
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- University of Utah FAX: +1 801 581 4148 -
- Department of Mathematics, 110 LCB Internet e-mail: beebe(a)math.utah.edu -
- 155 S 1400 E RM 233 beebe(a)acm.org beebe(a)computer.org -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ -
-------------------------------------------------------------------------------
Last week there was a bit of discussion about the different shells
that would eventually lead to srb writing the shell that took his name
and the command syntax and semantics that most modern shells use
today. Some of you may remember, VMS had a command interpreter
called DCL (Digital Command language), part of an attempt to make
command syntax uniform across DEC's different operating systems
(TOPS-20 also used DCL). As DEC started to recognize the value of the
Unix marketplace, a project was born in DEC's Commercial Languages and
Tools group to bring the Unix Bourne shell to VMS and to sell it as a
product they called DEC Shell.
I had been part of that effort and one of the issues we had to solve
is providing formal UNIX pipe semantics. They of course needed to
somehow implement UNIX style process pipelines. VMS from the
beginning has had an interprocess communications pseudo-device called
the mailbox that can be written to and read from via the usual I/O
mechanism (the QIO system service). A large problem with them is that
it is not possible to detect the "broken pipe" condition with a
mailbox and that feature deficiency made them unsuitable for use with
DEC Shell. So the team had me write a new device driver, based
closely on the mailbox driver, but that could detect broken pipes
lines UNIX-style.
Shortly after I finished the VMS pipe driver, the team at DECwest had
started work on the MICA project, which was Dave Culter's proposed OS
unification. Dave's team had developed a machine architecture called
PRISM (Proposed RISC Machine) to be the VAX follow-on. For forward
compatibility purposes, PRISM would have to support both Ultrix and
VMS. Dave and team had already written a microkernel-based,
lightweight OS for VAX called VAXeln that was intended for real-time
applications. His new idea was to have a MACH-like microkernel OS
which he called MICA and then to put three user mode personality
modules on top of that:
P.VMS, implementing the VMS system services and ABI
P.Ultrix, implementing the Unix system calls and ABI
P.TBD, a new OS API and ABI intended to supersede VMS
So I wrote the attached "why pipes" memo to explain to Cutler's team
why it was important to implement pipes natively in P.TBD if they
wanted that OS to be a viable follow-on to VMS and Ultrix.
In the end, Dick Sites's 64-bit RISC machine architecture proposal,
which was called Alpha, won out over PRISM. Cutler and a bunch of his
DECwest engineering team went off to Microsoft. Dave's idea of a
microkernel-based OS with multiple personalities of course saw the
light of day originally as NT OS/2, but because of the idea of
multiple personalities, when Microsoft and IBM divorced Dave was able
to quickly pivot to the now infamous Win32 personality, as what would
be called Windows NT. It was also easy for Softway Systems to later
complete the NT POSIX layer for their Interix product, which now a few
generations later is called WSL by Microsoft.
-Paul W.