From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16495 invoked from network); 14 Mar 2022 16:59:37 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 14 Mar 2022 16:59:37 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id E521B9D685; Tue, 15 Mar 2022 02:59:33 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 36B1C9D605; Tue, 15 Mar 2022 02:58:52 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 32D2E9D605; Tue, 15 Mar 2022 02:56:06 +1000 (AEST) Received: from mercury.lcs.mit.edu (mercury.lcs.mit.edu [18.26.0.122]) by minnie.tuhs.org (Postfix) with ESMTPS id 68E7E9D5FB for ; Tue, 15 Mar 2022 02:56:05 +1000 (AEST) Received: by mercury.lcs.mit.edu (Postfix, from userid 11178) id 4889918C075; Mon, 14 Mar 2022 12:56:04 -0400 (EDT) To: tuhs@minnie.tuhs.org Message-Id: <20220314165604.4889918C075@mercury.lcs.mit.edu> Date: Mon, 14 Mar 2022 12:56:04 -0400 (EDT) From: jnc@mercury.lcs.mit.edu (Noel Chiappa) Subject: Re: [TUHS] [tuhs] PDP-11 and early Unix X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jnc@mercury.lcs.mit.edu Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" > 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