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=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2710 invoked from network); 4 Jan 2022 20:38:10 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Jan 2022 20:38:10 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 675DB9C707; Wed, 5 Jan 2022 06:38:07 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 620729C6E5; Wed, 5 Jan 2022 06:37:33 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d+TVyYtu"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id F3E9C9C6E5; Wed, 5 Jan 2022 06:37:28 +1000 (AEST) Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) by minnie.tuhs.org (Postfix) with ESMTPS id E962A94A6B for ; Wed, 5 Jan 2022 06:37:27 +1000 (AEST) Received: by mail-oo1-f52.google.com with SMTP id c18-20020a4a3812000000b002da81004c1cso11935854ooa.13 for ; Tue, 04 Jan 2022 12:37:27 -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:content-language:to:from :subject; bh=Tc37hbFi4VpuO75IiPP5yDOQMtOePMgDfr3gRKaQoqs=; b=d+TVyYtuAX//1L0cag4xfOVxZC+plKDOMAUojUZiYeB00pjithbfEJ73xGtxbRyQRl uCy9C+35e6Gr8XPOmOQXh0wwFwYgYmOoWkttPVneRGjz0r1Z1KMkDXgvktG6bWi5OHlG IWN0PfL5ZCBlMXovDbEaP3rPiHBiDv4uso3AHyALPq11Ecg4c/U3XEurDTX2nd3Km+1r QZxjSEZxVGktDieEpLeuvjse+Q3M5kp3p5fShtLFkkZlS0AYAUjshMN7UHiuqRSqF8Sq 5r4lhDyaN2Tp3/Z2AoBT3899A3Jart+5vokFlxdqQseBwMHwg+cuTNSaaODwn/CmPQPr tM+A== 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 :content-language:to:from:subject; bh=Tc37hbFi4VpuO75IiPP5yDOQMtOePMgDfr3gRKaQoqs=; b=vPwPnWNUH8KpWTAaO/SdmJfnq3NcWGT+fZaX0xHM7/Kyv0recXSlGZBYqUBrltlJs5 eQI6YRdxLVoywgeATz4Uof7ceCU1YUMzzcXdLOECpIp5zv4vff4SyKVj3+j4Mr8qQjW9 iRJHl0Gj7bthTFmblwYDZuSRTOw/mXPVDInlRHnwywbRLWuQj817Kwf/LMHSE/JXaX25 fDhqOvlk55ZPaPCNR3XIju6K0ea4jpBciSN98PLGdVaTPsrAwe7zcXzk2kipekL0F37w a9FFwHiYagp7NdFEP3B2hKT1L0gIavLsGZQAmLUzWXMhAlrdWcV8gFKVouuzh7cYaTXJ d+wA== X-Gm-Message-State: AOAM532FSEhWVJg+wHaN3hU6sk+xogRo9Vsp13kzORLiY0uIDZ3ZwZZx jy8DlJ7hlc7l3uTBls4DZoz0ULL3pWPBRA== X-Google-Smtp-Source: ABdhPJw/xOBMd7PYXTDvZUZQtS/FhHDPotN9yoqEfpBlYqDgghtM/fcQRo/R0yomn1eYZ45GmipRcw== X-Received: by 2002:a05:6820:348:: with SMTP id m8mr509763ooe.12.1641328646860; Tue, 04 Jan 2022 12:37:26 -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 e15sm8276739oth.24.2022.01.04.12.37.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Jan 2022 12:37:26 -0800 (PST) Content-Type: multipart/alternative; boundary="------------ERRawV6k1U0X0XzwMjJq0uC6" Message-ID: <10197622-30fe-7553-2f2d-edc9637ff489@gmail.com> Date: Tue, 4 Jan 2022 14:37:25 -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: TUHS main list From: Will Senn Subject: [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: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" This is a multi-part message in MIME format. --------------ERRawV6k1U0X0XzwMjJq0uC6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit So, in v6, it was possible to use the mesg function from the system library with: ed hello.s / hello world using external mesg routine .globl mesg mov sp,r5 jsr r5,mesg; ; .even sys exit as hello.sld -s a.out -l a.out Hello, World! This was because v6 included mesg in the library, in v7, it doesn't look like mesg is included, so doing the same thing as above requires that code to write the message out be included and in addition system call names are not predefined, so exit and write have to be looked up in /usr/include/sys.s, resulting in the v7 equivalent file: ed hello2.s / hello world using internal mesg routine         mov     sp,r5         jsr     r5,mesg; ; .even         sys     1 mesg:         mov     r0,-(sp)         mov     r5,r0         mov     r5,0f 1:         tstb    (r5)+         bne     1b         sub     r5,r0         com     r0         mov     r0,0f+2         mov     $1,r0         sys     0; 9f .data 9:         sys     4; 0:..; .. .text         inc     r5         bic     $1,r5         mov     (sp)+,r0         rts     r5 as hello2.s a.out Hello, World! My questions are: 1. Is mesg or an equivalent available in v7? 2. If not, what was the v7 way of putting strings out? 3. Why aren't the system call names defined? 4. What was the v7 way of naming system calls? Will --------------ERRawV6k1U0X0XzwMjJq0uC6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit So,

in v6, it was possible to use the mesg function from the system library with:
        ed hello.s
	/ hello world using external mesg routine

	.globl  mesg

        mov     sp,r5
        jsr     r5,mesg; <Hello, World!\n\0>; .even
        sys     exit


	as hello.s
	ld -s a.out -l
	a.out
	Hello, World!

This was because v6 included mesg in the library, in v7, it doesn't look like mesg is included, so doing the same thing as above requires that code to write the message out be included and in addition system call names are not predefined, so exit and write have to be looked up in /usr/include/sys.s, resulting in the v7 equivalent file:

ed hello2.s
/ hello world using internal mesg routine

        mov     sp,r5
        jsr     r5,mesg; <Hello, World!\n\0>; .even
        sys     1

mesg:
        mov     r0,-(sp)
        mov     r5,r0
        mov     r5,0f
1:
        tstb    (r5)+
        bne     1b
        sub     r5,r0
        com     r0
        mov     r0,0f+2
        mov     $1,r0
        sys     0; 9f
.data
9:
        sys     4; 0:..; ..
.text
        inc     r5
        bic     $1,r5
        mov     (sp)+,r0
        rts     r5

as hello2.s
a.out
Hello, World!

My questions are:

1. Is mesg or an equivalent available in v7?
2. If not, what was the v7 way of putting strings out?
3. Why aren't the system call names defined?
4. What was the v7 way of naming system calls?

Will


--------------ERRawV6k1U0X0XzwMjJq0uC6--