The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Dan Cross <crossd@gmail.com>
To: Will Senn <will.senn@gmail.com>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] asm helper routines in v7
Date: Tue, 4 Jan 2022 16:12:08 -0500	[thread overview]
Message-ID: <CAEoi9W5dz_rk0KEzhxTpH8_AR4A3AH46S5WaK5KF==xG7_ZeBQ@mail.gmail.com> (raw)
In-Reply-To: <10197622-30fe-7553-2f2d-edc9637ff489@gmail.com>

On Tue, Jan 4, 2022 at 3:38 PM Will Senn <will.senn@gmail.com> wrote:
> [snip]
> My questions are:
>
> 1. Is mesg or an equivalent available in v7?

Perhaps just call printf?

> 2. If not, what was the v7 way of putting strings out?

Here's what I did:

$ rm -f h h.o
$ cat h.s
.globl _printf, _exit

mov     sp, r5
mov     $hi,(sp)
jsr     pc,*$_printf
mov     $0, (sp)
jsr     pc,*$_exit

hi: <Hello, World!\n\0>
$ as -o h.o h.s
$ ld -o h h.o -lc
$ ./h
Hello, World!
$ rm h h.o

> 3. Why aren't the system call names defined?

If I had to hazard a guess, it would have been to de-emphasize the use
of assembler for user code, particularly as 7th Edition was starting
to be portable beyond the PDP-11.

> 4. What was the v7 way of naming system calls?

I imagine the canonical way to invoke system calls from assembler was
invoking calling functions in the C library and linking against that.

        - Dan C.

  reply	other threads:[~2022-01-04 21:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 20:37 Will Senn
2022-01-04 21:12 ` Dan Cross [this message]
2022-01-04 21:24   ` Will Senn
2022-01-04 21:28     ` Warner Losh
2022-01-05 17:35       ` Dan Cross
2022-01-04 21:38 ` Clem Cole
2022-01-06  3:26 Douglas McIlroy
2022-01-06  3:37 ` Warner Losh
2022-01-06 16:00 ` Clem Cole

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='CAEoi9W5dz_rk0KEzhxTpH8_AR4A3AH46S5WaK5KF==xG7_ZeBQ@mail.gmail.com' \
    --to=crossd@gmail.com \
    --cc=tuhs@minnie.tuhs.org \
    --cc=will.senn@gmail.com \
    /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).