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.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 3560 invoked from network); 22 May 2020 22:08:50 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 22 May 2020 22:08:50 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id DC0A59C91D; Sat, 23 May 2020 08:08:49 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 877B99C194; Sat, 23 May 2020 08:08:35 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="m3mWiax8"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 784269C194; Sat, 23 May 2020 08:08:33 +1000 (AEST) Received: from mail-vk1-f178.google.com (mail-vk1-f178.google.com [209.85.221.178]) by minnie.tuhs.org (Postfix) with ESMTPS id 06D1E9C187 for ; Sat, 23 May 2020 08:08:33 +1000 (AEST) Received: by mail-vk1-f178.google.com with SMTP id m18so2928297vkk.9 for ; Fri, 22 May 2020 15:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y0R4pJzXhOqzc4s8LN7Curi9IZCbcukTxsRXoCq3y3M=; b=m3mWiax8k3FA6Cb5/vTu1ORYbpk3N7JMc1wLjRsVy4Os3oll9P9qMxAPf/NWdOK6l/ Pl3jspbcLIFADLRNrnnlRYscGrIxzTyxOuSptG1m1RolNpYu+wra61129O2RFfEyBBbn xLRNlmQBRSl8k3hNSzQJNyPU+yQdEQAv7eiPKVXZ3nS9FzDzFMK9IVcUhJ0xc7yZ2Y81 V5J4XwyCcd1yOstFV1kxUCL6awt3Fb+GaEwpVR1cVV6azOVscsR0KD45LmfVFDJ5lXNN yaEi2vAtC9LLmMOMGLSv2xqVh90IZ1hg12g4y+ZiAdNBhdZ1jnau8wVOjjGaLCgbC116 GNQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y0R4pJzXhOqzc4s8LN7Curi9IZCbcukTxsRXoCq3y3M=; b=cxw5NHVsZv8F7rKZRolX/qJGVX37e81KnukABA5lLGO95iaVokXYxXsiFYm9FitR+W w/6F4/Fj9SBhQrZPyRC/jKi/nmN4VHoWhvFjlm3qpIc4gSEZYfPytQV8dG5nO5Imxv00 v50e0+oOzIk71PWM+tB7GKtHlvaC+GA2aaoX6Aeq9IOjdPD8P8UgerJywuSdf/PHlxUi ts6CxrnTFrQl63+3K9w7T4ovx9Ekau/Qre3PGDD7JUJZQOcuZjx9AhmHXtP6BtIUJGZ8 QvE4I1rr3s8oJ6F6CjlhOv3yoSsWPPolzd4eLTx03m03wLabxgnvSlnPO28gYwaEAl46 ESJA== X-Gm-Message-State: AOAM532rBws6IyFINW0Lhk4lhz0sVXTSjNOCURfJPxKObxu9FIrAZ6cm zqMzUo/75NKZfQXv5RpCdCKmSNiu+NGUf5dwPq8Q/V8c X-Google-Smtp-Source: ABdhPJxoMAFejYLpDfdIriOBGXPGJc/IWPJzvGMY8DZvDvIkp3Ftp/XU2WoUZ4eHAbTSTxVtaLhJU5ZDYjIfCS1JHGU= X-Received: by 2002:a1f:110a:: with SMTP id 10mr12869621vkr.51.1590185312119; Fri, 22 May 2020 15:08:32 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Charles Anthony Date: Fri, 22 May 2020 15:08:15 -0700 Message-ID: To: Lawrence Stewart Content-Type: multipart/alternative; boundary="000000000000a7f07305a643de67" Subject: Re: [TUHS] where did "main" come from? 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: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000a7f07305a643de67 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, May 22, 2020 at 11:54 AM Lawrence Stewart wrote: > I can=E2=80=99t find an online copy of the Bell Laboratories BCPL manual > (Canaday/Thompson) from 1969 or anything about how to use BCPL on Multics > or CTSS. In general, Multics does not have a concept of "main"; the entry point of a program is the name of the program. Looking at the Multics runoff sources (written in BCPL) we see in the segment runoff_driver.bcpl: external $( RunoffCommand =3D "runoff" ... let RunoffCommand () be main $( MONITOR :=3D Open (StreamName + Write, "error_output") // Errors, etc. written here. ... BCPL replaces the name RunoffCommand with runoff during compilation; the compiled segment runoff_driver will have an entry point "runoff". Entering the command "runoff" will search segments in the search path for that entry point. Since segments can have multiple entry points, the idea of "main" (or "start" or "start_") as the defining entry point is not meaningful in Multics. The Multics C compiler (based on PCC) does have a concept of main; the C linker aliases that to the segment name, making the entry point name the same as the segment name. Thus compiling and linking foo.c generates a segment foo with an entry point foo, which points to main. (Actually, it aliases it to the C runtime library initialization which calls main.) -- Charles -- Charles --000000000000a7f07305a643de67 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Fri, May 22, 2020 at 11:54 AM Lawr= ence Stewart <stewart@serissa.com= > wrote:
= =C2=A0I can=E2=80=99t find an online copy of the Bell Laboratories BCPL man= ual (Canaday/Thompson) from 1969 or anything about how to use BCPL on Multi= cs or CTSS.

In general, Multics does not ha= ve a concept of "main"; the entry point of a program is the name = of the program. Looking at the Multics runoff sources (written in BCPL) we = see in the segment=C2=A0runoff_driver.bcpl:

extern= al
=C2=A0 =C2=A0 =C2=A0$( =C2=A0 RunoffCommand =3D "runo= ff"
...


let RunoffCommand () be= main
=C2=A0 =C2=A0 =C2=A0$( =C2=A0 MONITOR :=3D Open (StreamName + Writ= e, "error_output") =C2=A0 =C2=A0 =C2=A0 =C2=A0// =C2=A0Errors, et= c. written here.
...

BCPL replac= es the name=C2=A0RunoffCommand with=C2=A0runoff during compilation; the com= piled segment runoff_driver will have an entry point "runoff". En= tering the command "runoff" will search segments in the search pa= th for that entry point.

Since segments can have m= ultiple entry points, the idea of "main" (or "start" or= "start_") as the defining entry point is not meaningful in Multi= cs.

The Multics C compiler (based on PCC) does hav= e a=C2=A0 concept of main; the C linker aliases that to the segment name, m= aking the entry point name the same as the segment name. Thus compiling and= linking foo.c generates a segment foo with an entry point foo, which point= s to main. (Actually, it aliases it to the C runtime library initialization= which calls main.)

-- Charles
-- Charle= s



--000000000000a7f07305a643de67--