From: Will Senn <will.senn@gmail.com>
To: Dan Cross <crossd@gmail.com>
Cc: TUHS main list <tuhs@minnie.tuhs.org>
Subject: Re: [TUHS] asm helper routines in v7
Date: Tue, 4 Jan 2022 15:24:18 -0600 [thread overview]
Message-ID: <54ec532a-6603-6b25-fa9f-40aa9d111687@gmail.com> (raw)
In-Reply-To: <CAEoi9W5dz_rk0KEzhxTpH8_AR4A3AH46S5WaK5KF==xG7_ZeBQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1107 bytes --]
On 1/4/22 3:12 PM, Dan Cross wrote:
> 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.
Yep, that worked... you make it look so easy, and your rationales are
definitely believable :).
Will
[-- Attachment #2: Type: text/html, Size: 2208 bytes --]
next prev parent reply other threads:[~2022-01-04 21:24 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
2022-01-04 21:24 ` Will Senn [this message]
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=54ec532a-6603-6b25-fa9f-40aa9d111687@gmail.com \
--to=will.senn@gmail.com \
--cc=crossd@gmail.com \
--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).