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=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 10216 invoked from network); 29 Apr 2020 12:21:12 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 29 Apr 2020 12:21:12 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id ABCCC9C96C; Wed, 29 Apr 2020 22:21:10 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 5F4519C963; Wed, 29 Apr 2020 22:20:31 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; secure) header.d=mxes.net header.i=@mxes.net header.b="GZcN7FkX"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 27DA69C95A; Wed, 29 Apr 2020 22:20:29 +1000 (AEST) Received: from smtp-out-3.mxes.net (smtp-out-3.mxes.net [198.205.123.68]) by minnie.tuhs.org (Postfix) with ESMTPS id 37E029C841 for ; Wed, 29 Apr 2020 22:20:28 +1000 (AEST) Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 28086759BF; Wed, 29 Apr 2020 08:20:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1588162826; bh=mq1r7oAd9TkiTaxKi1wh0v2M3ZUsug8162x7uQso47w=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date: In-Reply-To:To:References; b=GZcN7FkX0gOqATI8dQ/bZQYtrilI/T0yivz7DIc+af5powvKnVxR1IXNoQbdWYMhM lmnNUJxztCCLEC2hqjsLd5DnllbHFTBXMGT1BOLAVfSPyA9qnjS22hkjyNUo0q+egF r14jjGc6rRXP8Ap+Gr2iLZyX/2/DuF/SfOpCR+eI= From: Ronald Natalie Message-Id: <56F9E80D-8942-4E05-A22F-4A6A123D4F71@ronnatalie.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_0E427057-3F60-421B-91FD-FFD0C32D23B1" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Date: Wed, 29 Apr 2020 08:20:25 -0400 In-Reply-To: To: Jacob Ritorto References: <20200429022654.D43FA18C08D@mercury.lcs.mit.edu> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Sent-To: 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: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --Apple-Mail=_0E427057-3F60-421B-91FD-FFD0C32D23B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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 > On Apr 29, 2020, at 12:08 AM, Jacob Ritorto = wrote: >=20 > Shoot, celebrated too soon. I rearranged it per your tutelage, Ron, = and it's still giving an Illegal Instruction error! > =46rom the adb output it looks like it's balking at the "14" = instruction at location 24, which, based on the BSD updates you = mentioned, I thought should've been taken as an arg, not an instruction, = right? >=20 > I assume this worked for you on some BSD, right? =20 > If so, is it a bug in the recent 2.11BSD patch release, perhaps? = Anyone able to help me understand? >=20 > > vi hello.s > "hello.s" 8 lines, 52 characters=20 > sys 4 > 1 > a > 6 > sys 1 > 0 > a: >=20 > "hello.s" 7 lines, 78 characters=20 > > as !$ > as hello.s > > ./a.out=20 > Illegal instruction (core dumped) > > od a.out > 0000000 000407 000022 000000 000000 000010 000000 000000 000000 > 0000020 104404 000001 000014 000006 104401 000000 062510 066154 > 0000040 005157 000000 000000 000002 000000 000000 000000 000000 > 0000060 000000 000000 000000 000004 000002 000014 000000 000006 > 0000100 000141 > 0000102 > > adb > adb> :s > stopped at 0: sys write > adb> :s > a.out: running > stopped at 04: 014 > adb> :s > a.out: running > Illegal instruction > stopped at 06: rtt > adb> :s > a.out: running > Illegal instruction - core dumped > process terminated > adb> >=20 >=20 > On Tue, Apr 28, 2020 at 10:26 PM Noel Chiappa > wrote: > > From: Jacob Ritorto >=20 > > I wonder if the differences are written up somewhere. I did try = to look > > for more documentation but came up short. >=20 > Sounds like a perfect topic for a CHWiki page. :-) E.g. this one: >=20 > http://gunkies.org/wiki/Unix_V6_internals = >=20 > which I did as a bit of an addendum to Lions, to explain rsav, qsav = and ssav, and > similar topics. >=20 >=20 > I noticed in the comparison of your two binary files that the = instructions > looked the same, but the a.out headers had a difference, but I didn't = remember > the fields in the a.out header enough to know what the differences = meant. >=20 > I thought I remembered doing an a.out page there, but apparently not. = I > thought about doing one now, but decided it wasn't worth it; I just = needed to > spin up my V6 system and do 'man a.out'! :-) >=20 > Noel >=20 --Apple-Mail=_0E427057-3F60-421B-91FD-FFD0C32D23B1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 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


On Apr 29, 2020, at 12:08 AM, Jacob Ritorto = <jacob.ritorto@gmail.com> wrote:

Shoot, celebrated too soon.  I = rearranged it per your tutelage, Ron, and it's still giving an  = Illegal Instruction error!
=46rom the adb output it = looks like it's balking at the "14" instruction at location 24, which, = based on the BSD updates you mentioned, I thought should've been taken = as an arg, not an instruction, right?

I assume this worked for = you on some BSD, right? 
If = so, is it a bug in the recent 2.11BSD patch release, perhaps?  = Anyone able to help me understand?
> vi hello.s
"hello.s" = 8 lines, 52 characters
        =  sys 4
         1
         a
  =        6
        = sys 1
        0
a: =      <Hello\n>

"hello.s"= 7 lines, 78 characters
> as !$
as = hello.s
> ./a.out
Illegal instruction = (core dumped)
> od a.out
0000000 =  000407 000022 000000 000000 000010 000000 000000 000000
0000020  104404 000001 000014 000006 104401 000000 = 062510 066154
0000040  005157 000000 000000 000002 = 000000 000000 000000 000000
0000060  000000 000000 = 000000 000004 000002 000014 000000 000006
0000100 =  000141
0000102
> adb
adb> :s
stopped at      0: =              sys     = write
adb> :s
a.out: running
stopped at      04:       =       <illegal op>    014
adb> :s
a.out: running
Illegal = instruction
stopped at      06:   =           rtt
adb> :s
a.out: running
Illegal instruction - core = dumped
process terminated
adb> >

On Tue, Apr 28, 2020 at 10:26 PM Noel = Chiappa <jnc@mercury.lcs.mit.edu> wrote:
    > From: Jacob = Ritorto

    > I wonder if the differences are written up = somewhere.  I did try to look
    > for more documentation but came up short.

Sounds like a perfect topic for a CHWiki page. :-) E.g. this one:

  http://gunkies.org/wiki/Unix_V6_internals

which I did as a bit of an addendum to Lions, to explain rsav, qsav and = ssav, and
similar topics.


I noticed in the comparison of your two binary files that the = instructions
looked the same, but the a.out headers had a difference, but I didn't = remember
the fields in the a.out header enough to know what the differences = meant.

I thought I remembered doing an a.out page there, but apparently not. = I
thought about doing one now, but decided it wasn't worth it; I just = needed to
spin up my V6 system and do 'man a.out'! :-)

   Noel


= --Apple-Mail=_0E427057-3F60-421B-91FD-FFD0C32D23B1--