From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 3643 invoked from network); 30 Apr 2020 21:50:29 -0000 Received-SPF: pass (minnie.tuhs.org: domain of minnie.tuhs.org designates 45.79.103.53 as permitted sender) receiver=inbox.vuxu.org; client-ip=45.79.103.53 envelope-from= Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 30 Apr 2020 21:50:29 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 799D69C9B9; Fri, 1 May 2020 07:50:26 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id A06099C853; Fri, 1 May 2020 07:49:55 +1000 (AEST) Received: by minnie.tuhs.org (Postfix, from userid 112) id 9FBC79C853; Fri, 1 May 2020 07:49:52 +1000 (AEST) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by minnie.tuhs.org (Postfix) with ESMTPS id 131F39C851 for ; Fri, 1 May 2020 07:49:49 +1000 (AEST) Received: by mail-qt1-f175.google.com with SMTP id k12so6475274qtm.4 for ; Thu, 30 Apr 2020 14:49:49 -0700 (PDT) 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:content-transfer-encoding; bh=P+jzrK/7zoOQec3A+b2jsQ5F35XSfTvBxQsmOG0dKoo=; b=BF418tM+tGmUXNZ5qrWjam+ycG5Hku625eCoMpkUQKSrrWbirLPCmWQslasTX4Rvgn HTJOn8G+Imc4MddrgEcu1Arsh243t7qTTyVucpeJSthJ1X5BHWY0+ep6T3gRngK4CN+w CeCWWGjjdeNZq98HFUSjHjDwgTvDAIFPqsHWk6EHZCmDAzkpE2X0LttJr/lWuiY6xGP/ GGnkBqBqsNj2VM/JvIHCzI7hrwMMkBV+h2bpr0NuMSuD4ghx/2FyyyAxqqbMmeAAjoMY wAw9WjhhFL85xRpm8BVJC4WwzwJVHdL6Dku9MbckpuWOT5vN3mrYOkgjSzvP9Y+VWbgP QwBw== X-Gm-Message-State: AGi0PuY+mIlmI6/IN/OBPngvQ5hdpMcgcWqAt321T+4wfMOAg5edZUA+ LcJVPADPurLT2EzZWnf1zqsVQcewKoyf1bmTrYABft15Tl4= X-Google-Smtp-Source: APiQypKMAgbeGOD9xZOKrNaxtweOtKuoBwFYT9591WznEaRlIpg6z+AOHo5UfpWY/gHEOiQSlk75YhwS5LEVgidSftk= X-Received: by 2002:ac8:45cc:: with SMTP id e12mr659884qto.39.1588283387968; Thu, 30 Apr 2020 14:49:47 -0700 (PDT) MIME-Version: 1.0 References: <9A1BF33E-49C9-4712-BF25-4C0BBC504CD1@planet.nl> In-Reply-To: From: Alexander Voropay Date: Fri, 1 May 2020 00:49:35 +0300 Message-ID: To: The Eunuchs Hysterical Society Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [TUHS] as(1) on Ultrix-11 vs 2.11BSD 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" Can anyone please explain the last $0 pushed to the stack ? Early SysIII ans SYSV on the i386 (and may be on i286) used similar syscall convention. I wrote about this: https://minnie.tuhs.org/pipermail/tuhs/2019-October/019274.html https://minnie.tuhs.org/pipermail/tuhs/2019-October/019294.html Example: =3D=3D=3D .file "test.s" .version "02.01" .set WRITE,4 .set EXIT,1 .text .align 4 .globl entry entry: pushl %ebp movl %esp,%ebp subl $8,%esp pushl $14 /length pushl $hello pushl $1 /STDOUT pushl $0 movl $WRITE,%eax lcall $0x07,$0 addl $16,%esp pushl $0 movl $EXIT,%eax lcall 0x07,$0 .data .align 4 hello: .byte 0x48,0x65,0x6c,0x6c,0x6f,0x2c, 0x20,0x77,0x6f,0x72 .byte 0x6c,0x64,0x21,0x0a,0x00 =D1=81=D1=80, 29 =D0=B0=D0=BF=D1=80. 2020 =D0=B3. =D0=B2 17:19, : > > Thanks for the link. With that help, I fixed the bug in the program: > > mov $6., -(sp) > mov $1f, -(sp) > mov $1,-(sp) > mov $0,-(sp) > sys 4 > add $8., sp > mov $0,-(sp) > mov $0,-(sp) > sys 1 > 1: > > > >> Sorry, I typed that in haste without testing. I don=E2=80=99t have a 2= .11 system > >> to try it on. However, reading the source code, I did that wrong. The > >> args go on the stack, not in line with the code. > >> mov $6, -(sp) > >> mov a, -(sp) > >> mov $1,-(sp) > >> sys 4 > > > > Without suggesting that every helpful post should be tested, I find the > > superb https://unix50.org web emulator excellent for such things. > > > > Many thanks to the folks hosting & maintaining this great resource! > > > > > >