The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: jnc@mercury.lcs.mit.edu (Noel Chiappa)
To: tuhs@minnie.tuhs.org
Cc: jnc@mercury.lcs.mit.edu
Subject: Re: [TUHS] Using printf from Assembly Language in V6, and db.
Date: Mon, 28 Jun 2021 16:37:28 -0400 (EDT)	[thread overview]
Message-ID: <20210628203728.8305818C090@mercury.lcs.mit.edu> (raw)

    > From: Paul Riley <paul@rileyriot.com>

    >> (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

             reply	other threads:[~2021-06-28 20:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 20:37 Noel Chiappa [this message]
2021-06-29 12:18 ` Paul Riley
  -- strict thread matches above, loose matches on Subject: below --
2021-06-28  4:48 Noel Chiappa
2021-06-28 11:27 ` Paul Riley
2021-06-28 13:48   ` Clem Cole
2021-06-28  2:34 Paul Riley
2021-06-28  3:27 ` Paul Riley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210628203728.8305818C090@mercury.lcs.mit.edu \
    --to=jnc@mercury.lcs.mit.edu \
    --cc=tuhs@minnie.tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).