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=HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5328 invoked from network); 29 Jun 2021 12:19:49 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 29 Jun 2021 12:19:49 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id B01089CB51; Tue, 29 Jun 2021 22:19:45 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 63EF79CB38; Tue, 29 Jun 2021 22:18:43 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 2E2989CB38; Tue, 29 Jun 2021 22:18:40 +1000 (AEST) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by minnie.tuhs.org (Postfix) with ESMTPS id 7A1909CA3B for ; Tue, 29 Jun 2021 22:18:39 +1000 (AEST) Received: by mail-pg1-f170.google.com with SMTP id e33so18328951pgm.3 for ; Tue, 29 Jun 2021 05:18:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qqAknXI+y5seBykWybXMLKRum+jK6bhNzkgV90nnDws=; b=Urmo5oMR/hfw0RxKjAl4CtrvjkteVG8Jdib85OjKM/Z1gwwGtgMPdCzmPUQ/FfrmUB sLm6D2753llEys5wylquidpoqaIGe1W53PlbN7xxLe0YqlGpytQzjvlvpSKTGU9MPPE6 INhsUa878T/qkGETs7yvA5jZ7qooAdfTiHCEod4Zpt5yPuA18MrHwGc22wC285MZcvRP HcU3NKyaYGJj5pTBPPKUSE3VbrLPD+A2i+6yf59DU9x5pZozL41TB+0oKo3TkwIfVoDj xbyp34mRKnalK1CA+aRajdBX9rxUbTXTL7yjdPdvzEkgpm0d7oTaPv1AFdC9OjbP89tx uBHA== X-Gm-Message-State: AOAM530pQlgbj2HcJpRRY1NJfINXhjgf9s3r3oOBg6xsN0YZoG47psS/ 0o2v0oU+KRwAWy46IU5tiTGRyVU/lsDL1YOiTEQ= X-Google-Smtp-Source: ABdhPJxXOlYL+8+X1JC8TEFarfvPTbLjGazjlQtcMt4XC/bKKEwlXI1c09+g8ZKjda3xkhj+2sZWWV3pgU472F4uL+c= X-Received: by 2002:a63:e407:: with SMTP id a7mr27889508pgi.220.1624969118060; Tue, 29 Jun 2021 05:18:38 -0700 (PDT) MIME-Version: 1.0 References: <20210628203728.8305818C090@mercury.lcs.mit.edu> In-Reply-To: <20210628203728.8305818C090@mercury.lcs.mit.edu> From: Paul Riley Date: Tue, 29 Jun 2021 22:18:26 +1000 Message-ID: To: Noel Chiappa , Clem Cole Content-Type: multipart/alternative; boundary="0000000000000d94bd05c5e69b21" 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: tuhs Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --0000000000000d94bd05c5e69b21 Content-Type: text/plain; charset="UTF-8" Thanks Noel, Clem for your always generous and highly informative answers. I'll digest that and enjoy using C routines in my assembly programs! Paul *Paul Riley* Email: paul@rileyriot.com On Tue, 29 Jun 2021 at 06:37, Noel Chiappa wrote: > > 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 > --0000000000000d94bd05c5e69b21 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks Noel, Clem for your always generous and highly info= rmative answers. I'll digest that and enjoy using C routines in my asse= mbly programs!

Paul

Paul Riley


<= div dir=3D"ltr" class=3D"gmail_attr">On Tue, 29 Jun 2021 at 06:37, Noel Chi= appa <jnc@mercury.lcs.mit.edu= > wrote:
= =C2=A0 =C2=A0 > From: Paul Riley <paul@rileyriot.com>

=C2=A0 =C2=A0 >> (I wrote a note, BITD, explaining how all this worke= d; I'll upload it
=C2=A0 =C2=A0 >> to the CHWiki when I get a chance.)

Now here:

=C2=A0 https://gunkies.org/wiki/PDP-11_C_stack_oper= ation

along with simple examples of args and auto variables, which are both
referenced via the FP.


=C2=A0 =C2=A0 > As a non-C consumer of printf, should I point R5 at some= space for a
=C2=A0 =C2=A0 > stack and call printf in the same manner as the C exampl= e I cited?

Not necessary to do anything with R5 (you can leave it blank); the only thi= ngs
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:

=C2=A0 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.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Noel
--0000000000000d94bd05c5e69b21--