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, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31343 invoked from network); 28 Jun 2021 20:38:39 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 28 Jun 2021 20:38:39 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id AC5919CB38; Tue, 29 Jun 2021 06:38:35 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 582BD9CA68; Tue, 29 Jun 2021 06:37:33 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 167B69CA5F; Tue, 29 Jun 2021 06:37:30 +1000 (AEST) Received: from mercury.lcs.mit.edu (mercury.lcs.mit.edu [18.26.0.122]) by minnie.tuhs.org (Postfix) with ESMTPS id 94EB79CA3B for ; Tue, 29 Jun 2021 06:37:29 +1000 (AEST) Received: by mercury.lcs.mit.edu (Postfix, from userid 11178) id 8305818C090; Mon, 28 Jun 2021 16:37:28 -0400 (EDT) To: tuhs@minnie.tuhs.org Message-Id: <20210628203728.8305818C090@mercury.lcs.mit.edu> Date: Mon, 28 Jun 2021 16:37:28 -0400 (EDT) From: jnc@mercury.lcs.mit.edu (Noel Chiappa) Subject: Re: [TUHS] Using printf from Assembly Language in V6, and db. 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: Paul Riley >> (I wrote a note, BITD, explaining how all this worked; I'll upload it >> to the CHWiki when I get a chance.) Now here: https://gunkies.org/wiki/PDP-11_C_stack_operation along with simple examples of args and auto variables, which are both referenced via the FP. > As a non-C consumer of printf, should I point R5 at some space for a > stack and call printf in the same manner as the C example I cited? Not necessary to do anything with R5 (you can leave it blank); the only things a PDP-11 C routine needs are: - a good stack - the arguments, and return point, on the top of the stack csv will set up the frame pointer, making no assumptions about the old contents of R5 - see the source: http://ana-3.lcs.mit.edu/~jnc/tech/unix/lib/csv.s although it does save the old R5 contents, and restore them on exit. Noel