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.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8328 invoked from network); 4 Jan 2022 21:24:41 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Jan 2022 21:24:41 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id EBA4D9C701; Wed, 5 Jan 2022 07:24:38 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id BD9BE9C6E5; Wed, 5 Jan 2022 07:24:23 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ITDuJt6i"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 4559B9C6E5; Wed, 5 Jan 2022 07:24:21 +1000 (AEST) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by minnie.tuhs.org (Postfix) with ESMTPS id C273894A6B for ; Wed, 5 Jan 2022 07:24:20 +1000 (AEST) Received: by mail-oi1-f177.google.com with SMTP id v6so61259670oib.13 for ; Tue, 04 Jan 2022 13:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to; bh=Cc8xucf6Lqc5+/fNsUtugMTKRxODQU2AZHTTarxOJSA=; b=ITDuJt6iwMHDNbA3hzjKK5/GuchWGOUHjR+mCYc1vQIumDFJZroxECCeTB5p/2nnj2 HjQK9Dy9wC88LSCNnMyVMBZn+z4ks+uqBDcB2oVY+bh1V3KXUlwnxhrG1BYkVhwtw2Gx GjoAGWoSkFN9g6ZLdWoDxO55AWL6A0/A9KUIU3X3ezKAssnmIbca/Q8Bue3ufpdbwx/z cRAbsPTGkvxfwZ/V4k+orPbr86IhIdSveDm13dwXYWGUTOLSbdAMtQQzgULUEpm3908s v7/Q50kzTb7M7QIReRF/D1Kq2TOhRLlf4TWUg7el+Q7YFtkvlEYvF31k4lVo/LEl0MfH 8KnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to; bh=Cc8xucf6Lqc5+/fNsUtugMTKRxODQU2AZHTTarxOJSA=; b=Qe1/j8lD2e3kvGgh+H77qChA3JwicWj2Tugp5jN+UPS07h8ZCjhjiLcTISN/o+cV9l rrZpTRq9bxfHFmLdGwChcBeVcSbEhboubN+0Qf5DO/M3+d4KAPmTfKQkOu3My7PChFt/ yjWgvVeRAghVrmC1jT1eiEBErKY+KiBpZiH8rdQWpzPNl7DxOGEFJ3HN/WaR0So8gpwo 3hE7Tgm/8s5S/V/tqKSOGkNeyqRYXJh+xjxdnursnJteyUi6E3bI8CflB3du8RLdNk1m 7w5xKF5DOlVgszrAtTgxnmdhPw/anYTbGh3rq91ZLl4qk2stZZ0qH58zi2z5hXyd2uG9 87EQ== X-Gm-Message-State: AOAM531UL7q2adWYdhBYsnTb3zIhMXU0P3DHSSX06Z2/R8MG5CPut6a7 vvowZtS8YE4qhmNYbtTcMOYY0B2vTx51Mg== X-Google-Smtp-Source: ABdhPJymBCAhIXhbmW+iYMhWXN7pEr79UGXwTQd3/fjLUcXMvyODJk08O6qRDM1lu6n1k9t/WLolpg== X-Received: by 2002:aca:1708:: with SMTP id j8mr219977oii.62.1641331460057; Tue, 04 Jan 2022 13:24:20 -0800 (PST) Received: from [192.168.1.13] (035-134-121-000.res.spectrum.com. [35.134.121.0]) by smtp.gmail.com with ESMTPSA id b17sm8498558ots.66.2022.01.04.13.24.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jan 2022 13:24:19 -0800 (PST) Content-Type: multipart/alternative; boundary="------------MPp7ThJiEpalH75h48simXSQ" Message-ID: <54ec532a-6603-6b25-fa9f-40aa9d111687@gmail.com> Date: Tue, 4 Jan 2022 15:24:18 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Content-Language: en-US To: Dan Cross References: <10197622-30fe-7553-2f2d-edc9637ff489@gmail.com> From: Will Senn In-Reply-To: Subject: Re: [TUHS] asm helper routines in v7 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 main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" This is a multi-part message in MIME format. --------------MPp7ThJiEpalH75h48simXSQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/4/22 3:12 PM, Dan Cross wrote: > On Tue, Jan 4, 2022 at 3:38 PM Will Senn 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: > $ 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 --------------MPp7ThJiEpalH75h48simXSQ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
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
--------------MPp7ThJiEpalH75h48simXSQ--