Received: (from major@localhost)
	by minnie.cs.adfa.edu.au (8.9.3/8.9.3) id KAA03506
	for pups-liszt; Wed, 8 Sep 1999 10:58:18 +1000 (EST)
Received: from timaxp.trailing-edge.com (timaxp.trailing-edge.com [63.73.218.130])
	by minnie.cs.adfa.edu.au (8.9.3/8.9.3) with SMTP id KAA03501
	for <PUPS@MINNIE.CS.ADFA.edu.AU>; Wed, 8 Sep 1999 10:58:10 +1000 (EST)
Received: by timaxp.trailing-edge.com for PUPS@MINNIE.CS.ADFA.edu.AU;
          Tue, 7 Sep 1999 21:12:00 -0400
Date: Tue, 7 Sep 1999 21:12:00 -0400
From: Tim Shoppa <SHOPPA@trailing-edge.com>
To: PUPS@minnie.cs.adfa.edu.au
Message-Id: <990907211200.2020016c@trailing-edge.com>
Subject: Re: Diff between 11/20 and 11/45?
Sender: owner-pups@minnie.cs.adfa.edu.au
Precedence: bulk

>These executables were written for a PDP-11/20. Are there any significant
>USER-MODE differences between the 11/20 and later PDP-11 models? I'm
>thinking missing instructions, different addressing mode behaviour etc.

Well, first of all, there is no "User mode" on the 11/20 unless you have
a KT11 installed.  Everything is kernel mode with no KT11.  Maybe the
executables are trying to go out and directly bang on the console CSR's,
the switch register, or the interrupt vectors themselves?

11/20's also frequently had the EAE (Extended Arithmetic Element)
installed, to make up for the fact that there was no multiply, divide,
or multiple shift instructions in the native instruction set (and
wouldn't be until the EIS came along.)  The EAE was a peripheral
living in I/O space (773000-777316); you wrote the operands to the EAE
locations and read the results later.  You can put a EAE in a machine
with EIS, but generally you only did this if you had some binaries without
sources using the EAE (I know of several sites running 11/24's and 11/44's
with EAE's today)

There are many other differences, especially dealing with "funny" address
modes.  Generally, folks like me who have to code so that something works
across all the -11's know better than to do these things, but back when
there was *only* the 11/20 some folks didn't know any better and used
them anyway.

First, we have instructions that use the same register as source
and destination, with an auto-increment one or the other:

1.  OPR R,(R)+ on an 11/20 increments R before it's used as a source
operand.  On an 11/45 the initial contents of R are used.

2.  Same thing for OPR R,-(R).

3.  JMP (R)+ or JSR reg,(R)+ increments R before putting it in the PC
on the 11/20; on the 11/45 R isn't incremented until after the old
value is put in the PC.

4.  On an 11/20, JMP %R traps to 4; on an 11/45, JMP %R traps to 10

5.  On an 11/20, SWAB does not change the V flag; on every other machine,
SWAB clears V.  (In the 11/20 processor handbook, it *says* that SWAB
clears the V flag, but that's not the way the machine actually worked!)

6.  On an 11/20, R0-R7 can be used by the program at addresses 177700-
177717; on any other machine, they can't be used that way and will
result in a non-existent memory (NXM) trap.  This can be used for some
neat tricks where you run code out of the registers (which of course
is quite non-portable!)

There's lots more differences, having to do with T bits and interrupt
handling, but I don't know if you're getting that far... and these
aren't things that you have to worry about in user mode, anyway.

-- 
 Tim Shoppa                        Email: shoppa@trailing-edge.com
 Trailing Edge Technology          WWW:   http://www.trailing-edge.com/
 7328 Bradley Blvd		   Voice: 301-767-5917
 Bethesda, MD, USA 20817           Fax:   301-767-5927

