Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

186,000 Miles per Second. It's not just a good idea. IT'S THE LAW.


devel / alt.lang.asm / ARM

SubjectAuthor
* ARMPaul Edwards
`* Re: ARMPaul Edwards
 `* Re: ARMPaul Edwards
  `- Re: ARMPaul Edwards

1
ARM

<2a9449f1-0f88-4ab6-b365-48fd8fc31cf1n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=365&group=alt.lang.asm#365

 copy link   Newsgroups: alt.lang.asm
X-Received: by 2002:ae9:f006:0:b0:6e4:9fd5:bf5c with SMTP id l6-20020ae9f006000000b006e49fd5bf5cmr3952417qkg.139.1665908799704;
Sun, 16 Oct 2022 01:26:39 -0700 (PDT)
X-Received: by 2002:a81:130a:0:b0:360:9739:82be with SMTP id
10-20020a81130a000000b00360973982bemr4885395ywt.69.1665908799483; Sun, 16 Oct
2022 01:26:39 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: alt.lang.asm
Date: Sun, 16 Oct 2022 01:26:39 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=111.90.199.79; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 111.90.199.79
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2a9449f1-0f88-4ab6-b365-48fd8fc31cf1n@googlegroups.com>
Subject: ARM
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Sun, 16 Oct 2022 08:26:39 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1269
 by: Paul Edwards - Sun, 16 Oct 2022 08:26 UTC

I now have binutils 2.14a (my derivative) handling ARM
code (a.out and ELF), available at pdos.org.

I have some code that is failing:

armsupa.asm:229: Error: bad instruction `asr r4,r0,#31'

Probably because it is using a more modern syntax.

Anyone know what the oldest equivalent to that is?

Thanks. Paul.

Re: ARM

<d080e893-dacd-410a-b9ec-561989602b01n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=366&group=alt.lang.asm#366

 copy link   Newsgroups: alt.lang.asm
X-Received: by 2002:ac8:59c2:0:b0:39c:e3b4:1265 with SMTP id f2-20020ac859c2000000b0039ce3b41265mr8930482qtf.55.1666036579561;
Mon, 17 Oct 2022 12:56:19 -0700 (PDT)
X-Received: by 2002:a0d:e201:0:b0:354:1e40:be19 with SMTP id
l1-20020a0de201000000b003541e40be19mr10543751ywe.244.1666036579232; Mon, 17
Oct 2022 12:56:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: alt.lang.asm
Date: Mon, 17 Oct 2022 12:56:18 -0700 (PDT)
In-Reply-To: <2a9449f1-0f88-4ab6-b365-48fd8fc31cf1n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=110.54.142.182; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 110.54.142.182
References: <2a9449f1-0f88-4ab6-b365-48fd8fc31cf1n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d080e893-dacd-410a-b9ec-561989602b01n@googlegroups.com>
Subject: Re: ARM
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Mon, 17 Oct 2022 19:56:19 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1600
 by: Paul Edwards - Mon, 17 Oct 2022 19:56 UTC

On Sunday, October 16, 2022 at 4:26:40 PM UTC+8, Paul Edwards wrote:
> I now have binutils 2.14a (my derivative) handling ARM
> code (a.out and ELF), available at pdos.org.
>
> I have some code that is failing:
>
> armsupa.asm:229: Error: bad instruction `asr r4,r0,#31'
>
> Probably because it is using a more modern syntax.
>
> Anyone know what the oldest equivalent to that is?
>
> Thanks. Paul.

It seems I need pre-UAL syntax which may be:

mov r4,r0,ror #31

BFN. Paul.

Re: ARM

<893ccf25-185b-41f4-be70-c456031d7994n@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=368&group=alt.lang.asm#368

 copy link   Newsgroups: alt.lang.asm
X-Received: by 2002:a05:622a:15c7:b0:39b:2791:cd44 with SMTP id d7-20020a05622a15c700b0039b2791cd44mr7613239qty.676.1666202787777;
Wed, 19 Oct 2022 11:06:27 -0700 (PDT)
X-Received: by 2002:a05:6902:13c8:b0:6af:f2b8:e164 with SMTP id
y8-20020a05690213c800b006aff2b8e164mr7810018ybu.466.1666202787546; Wed, 19
Oct 2022 11:06:27 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: alt.lang.asm
Date: Wed, 19 Oct 2022 11:06:27 -0700 (PDT)
In-Reply-To: <d080e893-dacd-410a-b9ec-561989602b01n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=110.54.142.182; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 110.54.142.182
References: <2a9449f1-0f88-4ab6-b365-48fd8fc31cf1n@googlegroups.com> <d080e893-dacd-410a-b9ec-561989602b01n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <893ccf25-185b-41f4-be70-c456031d7994n@googlegroups.com>
Subject: Re: ARM
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Wed, 19 Oct 2022 18:06:27 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 3157
 by: Paul Edwards - Wed, 19 Oct 2022 18:06 UTC

On Tuesday, October 18, 2022 at 3:56:20 AM UTC+8, Paul Edwards wrote:
> On Sunday, October 16, 2022 at 4:26:40 PM UTC+8, Paul Edwards wrote:
> > I now have binutils 2.14a (my derivative) handling ARM
> > code (a.out and ELF), available at pdos.org.
> >
> > I have some code that is failing:
> >
> > armsupa.asm:229: Error: bad instruction `asr r4,r0,#31'
> >
> > Probably because it is using a more modern syntax.
> >
> > Anyone know what the oldest equivalent to that is?
> >
> > Thanks. Paul.

> It seems I need pre-UAL syntax which may be:
>
> mov r4,r0,ror #31

Unfortunately that doesn't seem to be a full replacement.

I don't know ARM assembler, but I have a theory that the mov
is changing the zero flag, where asr did not, and that the "bl"
is thus not happening. Maybe an unconditional "b" is best?

After commenting out the below instruction, modulus now
works, and I don't have any issue. But I assume those
instructions are there for a reason and they should be
added back when the asr is properly replaced.

Anyone know?

https://sourceforge.net/p/pdos/gitcode/ci/master/tree/pdpclib/armsupa.asm

# signed integer modulo
# in: r0 = num, r1 = den
# out: r0 = rem

.globl __modsi3
.globl ___modsi3
.align 2
__modsi3:
___modsi3:
stmfd sp!,{lr}
# asr r4,r0,#31 @ r4 = sign
# mov r4,r0,ror #31
bl ___divsi3
mov r0,r1
# cmp r4,#0
# rsbne r0,r0,#0
ldmia sp!,{pc}

# unsigned integer modulo
# in: r0 = num, r1 = den
# out: r0 = rem

.globl __umodsi3
.globl ___umodsi3
.align 2
__umodsi3:
___umodsi3:
stmfd sp!,{lr}
# asr r4,r0,#31 @ r4 = sign
# mov r4,r0,ror #31
bl ___udivsi3
mov r0,r1
# cmp r4,#0
# rsbne r0,r0,#0
ldmia sp!,{pc}

Thanks. Paul.

Re: ARM

<449d5507-38ab-4838-998f-3e703951407cn@googlegroups.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=369&group=alt.lang.asm#369

 copy link   Newsgroups: alt.lang.asm
X-Received: by 2002:a37:4cd:0:b0:6ec:5396:3abe with SMTP id 196-20020a3704cd000000b006ec53963abemr16010418qke.293.1666420724563;
Fri, 21 Oct 2022 23:38:44 -0700 (PDT)
X-Received: by 2002:a25:da08:0:b0:6be:34b9:55e with SMTP id
n8-20020a25da08000000b006be34b9055emr19543918ybf.308.1666420724388; Fri, 21
Oct 2022 23:38:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: alt.lang.asm
Date: Fri, 21 Oct 2022 23:38:44 -0700 (PDT)
In-Reply-To: <893ccf25-185b-41f4-be70-c456031d7994n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=110.54.142.182; posting-account=CeHKkQoAAAAowY1GfiJYG55VVc0s1zaG
NNTP-Posting-Host: 110.54.142.182
References: <2a9449f1-0f88-4ab6-b365-48fd8fc31cf1n@googlegroups.com>
<d080e893-dacd-410a-b9ec-561989602b01n@googlegroups.com> <893ccf25-185b-41f4-be70-c456031d7994n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <449d5507-38ab-4838-998f-3e703951407cn@googlegroups.com>
Subject: Re: ARM
From: mutazi...@gmail.com (Paul Edwards)
Injection-Date: Sat, 22 Oct 2022 06:38:44 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1682
 by: Paul Edwards - Sat, 22 Oct 2022 06:38 UTC

This appears to be the correct code.

Note that I used asr (arithmetic shift right) instead of
ror, and I needed to preserve r4.

.globl __modsi3
.globl ___modsi3
.align 2
__modsi3:
___modsi3:
stmfd sp!,{r4,lr}
# asr r4,r0,#31 @ r4 = sign
mov r4,r0,asr#31
bl ___divsi3
mov r0,r1
cmp r4,#0
rsbne r0,r0,#0
ldmia sp!,{r4,pc}

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor