Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

Perl will always provide the null. -- Larry Wall in <199801151818.KAA14538@wall.org>


devel / comp.os.cpm / Re: 8080 question

SubjectAuthor
* 8080 questiondxforth
+* 8080 questionPeter Heitzer
|`* 8080 questionDouglas Miller
| `* 8080 questionPeter Heitzer
|  +- 8080 questionDouglas Miller
|  `* 8080 questiondxforth
|   +- 8080 questionPeter Heitzer
|   `* 8080 questionRussell Marks
|    `* 8080 questiondxforth
|     `* 8080 questionMark Lougheed
|      `* 8080 questionPeter Heitzer
|       `- 8080 questionMark Ogden
+* 8080 questionPhillip Stevens
|`* 8080 questiondxforth
| `* 8080 questionPhillip Stevens
|  `* 8080 questiondxforth
|   `* 8080 questionPhillip Stevens
|    `- 8080 questiondxforth
`* 8080 questionGeorge Phillips
 +- 8080 questiondxforth
 `- 8080 questionMark Ogden

1
8080 question

<uaciqs$3ured$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4349&group=comp.os.cpm#4349

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: 8080 question
Date: Wed, 2 Aug 2023 13:33:48 +1000
Organization: A noiseless patient Spider
Lines: 5
Message-ID: <uaciqs$3ured$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 03:33:48 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7c27edf3620761d649a7398e002ad88a";
logging-data="4156877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qQj4y7e/+W4RBjEn2o6Jp"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:XbxO9i9ZZllqrEjNt2xCCxyQwF0=
Content-Language: en-GB
 by: dxforth - Wed, 2 Aug 2023 03:33 UTC

I have a count in a double register.

Is there a way to decrement and test for 0 without using the A register?

Re: 8080 question

<kiuj4aFs47aU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4350&group=comp.os.cpm#4350

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: peter.heitzer@rz.uni-regensburg.de (Peter Heitzer)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: 2 Aug 2023 08:40:42 GMT
Lines: 21
Message-ID: <kiuj4aFs47aU1@mid.individual.net>
References: <uaciqs$3ured$1@dont-email.me>
X-Trace: individual.net rjsSMPNER87a60c9ZwzBEA2miWR5QEAus1pgfztwzT4Uq1HDc5+6FXdJY0
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:E4pMYW10y+IeGb77rMp5DQS41cU= sha256:lay1A2ijsd6Da9r+yRdYC6vHP/wGYCBd0e+TgAWxzVc=
User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (Linux/4.19.0-24-amd64 (x86_64))
 by: Peter Heitzer - Wed, 2 Aug 2023 08:40 UTC

dxforth <dxforth@gmail.com> wrote:
>I have a count in a double register.

>Is there a way to decrement and test for 0 without using the A register?
No fast way.
Only the 8 bit register opcodes set the flags. So you cannot use
a 16 bit decrement but have to do the decrement with the high and low
registers.
Decrement low register.
If carry was set decrement the high register and continue.
If z was set decrement the high register and check if carry was set.
That means that the high register was zero before the decrement.
If no carry was set you have to increment the high register in order to
restore the value before the decrement.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de

Re: 8080 question

<c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4351&group=comp.os.cpm#4351

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ae9:df43:0:b0:763:ce7e:f280 with SMTP id t64-20020ae9df43000000b00763ce7ef280mr4380qkf.11.1690974253944;
Wed, 02 Aug 2023 04:04:13 -0700 (PDT)
X-Received: by 2002:a05:6808:1491:b0:3a3:b8ab:c211 with SMTP id
e17-20020a056808149100b003a3b8abc211mr26670750oiw.4.1690974253779; Wed, 02
Aug 2023 04:04:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news-1.dfn.de!news.dfn.de!npeer.as286.net!npeer-ng0.as286.net!peer01.ams1!peer.ams1.xlned.com!news.xlned.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: comp.os.cpm
Date: Wed, 2 Aug 2023 04:04:13 -0700 (PDT)
In-Reply-To: <kiuj4aFs47aU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=96.42.194.246; posting-account=5XW4vgoAAADMD8xScYja8bdzAXoYQrTS
NNTP-Posting-Host: 96.42.194.246
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com>
Subject: Re: 8080 question
From: durgadas311@gmail.com (Douglas Miller)
Injection-Date: Wed, 02 Aug 2023 11:04:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1600
 by: Douglas Miller - Wed, 2 Aug 2023 11:04 UTC

NOTE! 8-bit increment/decrement does NOT affect the carry. Only sign or zero may be detected after those. If you use zero as the trigger for a dual 8-bit decrement loop (i.e. accomplishing a 16-bit decrement using two 8-bit decrements) you need to take into account that zero is not the same as carry and you will have to adjust your starting counts accordingly.

Re: 8080 question

<kiuu4cFtrrqU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4352&group=comp.os.cpm#4352

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: peter.heitzer@rz.uni-regensburg.de (Peter Heitzer)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: 2 Aug 2023 11:48:28 GMT
Lines: 13
Message-ID: <kiuu4cFtrrqU1@mid.individual.net>
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net> <c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com>
X-Trace: individual.net 7RBHodiuCByS0XsKMb13pQr8sqdqzDhw9O5CdbQzYEb3CwO0tDrOvXDFLS
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:rfThakC5PptKoX3QS2xeRy6qIqk= sha256:CJc8HGImMaRFjLb8sJZsRwjA1GQ5xx2x6V8p2WwZjC8=
User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (Linux/4.19.0-24-amd64 (x86_64))
 by: Peter Heitzer - Wed, 2 Aug 2023 11:48 UTC

Douglas Miller <durgadas311@gmail.com> wrote:
>NOTE! 8-bit increment/decrement does NOT affect the carry. Only sign or zero may be detected after those. If you use zero as the trigger for a dual 8-bit decrement loop (i.e. accomplishing a 16-bit decrement using two 8-bit decrements) you need to take into account that zero is not the same as carry and you will have to adjust your starting counts accordingly.

You are right. My mistake. Using only the detection of zero a possible
solution is doing a 16 bit decrement and for the low and high bytes
an increment followed by a decrement. So the value of the register does
not change but only the flags are set. A test costs 36 cycles if
both registers have to be checked or at least 18 cycles if the low byte
is not zero after the 16 Bit decrement.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de

Re: 8080 question

<1f8d461b-c60f-490a-9a4e-a5e7a9658964n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4353&group=comp.os.cpm#4353

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:1934:b0:63c:fe6e:bb4 with SMTP id es20-20020a056214193400b0063cfe6e0bb4mr69231qvb.0.1690979165956;
Wed, 02 Aug 2023 05:26:05 -0700 (PDT)
X-Received: by 2002:a05:6808:1455:b0:3a3:8c81:a86f with SMTP id
x21-20020a056808145500b003a38c81a86fmr26913438oiv.7.1690979165614; Wed, 02
Aug 2023 05:26:05 -0700 (PDT)
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!diablo1.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: comp.os.cpm
Date: Wed, 2 Aug 2023 05:26:05 -0700 (PDT)
In-Reply-To: <kiuu4cFtrrqU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=96.42.194.246; posting-account=5XW4vgoAAADMD8xScYja8bdzAXoYQrTS
NNTP-Posting-Host: 96.42.194.246
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net>
<c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com> <kiuu4cFtrrqU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1f8d461b-c60f-490a-9a4e-a5e7a9658964n@googlegroups.com>
Subject: Re: 8080 question
From: durgadas311@gmail.com (Douglas Miller)
Injection-Date: Wed, 02 Aug 2023 12:26:05 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2314
 by: Douglas Miller - Wed, 2 Aug 2023 12:26 UTC

On Wednesday, August 2, 2023 at 6:48:32 AM UTC-5, Peter Heitzer wrote:
> You are right. My mistake. Using only the detection of zero a possible
> solution is doing a 16 bit decrement and for the low and high bytes
> an increment followed by a decrement. So the value of the register does
> not change but only the flags are set. A test costs 36 cycles if
> both registers have to be checked or at least 18 cycles if the low byte
> is not zero after the 16 Bit decrement.
> --
> Dipl.-Inform(FH) Peter Heitzer, peter....@rz.uni-regensburg.de

Typically, I just see that the starting count is adjusted to account for the difference. These cases just use the zero flag to detect the carry over, but the starting count makes less sense (possibly, depending on whether it was an arbitrary number or had specific meaning). I've also seen these sorts of loops be "inverted" (do increment instead of decrement), which means the starting count needs to be negative - but usually makes more sense in terms of absolute numbers.

Re: 8080 question

<uadk3j$2hu0$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4354&group=comp.os.cpm#4354

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: Wed, 2 Aug 2023 23:01:39 +1000
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <uadk3j$2hu0$1@dont-email.me>
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net>
<c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com>
<kiuu4cFtrrqU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 2 Aug 2023 13:01:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7c27edf3620761d649a7398e002ad88a";
logging-data="83904"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/86wo428Fp+MNGcXVZ+fAi"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:Fl0BwmwAFXK2KW9r+tVuojzp7WY=
In-Reply-To: <kiuu4cFtrrqU1@mid.individual.net>
Content-Language: en-GB
 by: dxforth - Wed, 2 Aug 2023 13:01 UTC

On 2/08/2023 9:48 pm, Peter Heitzer wrote:
> Douglas Miller <durgadas311@gmail.com> wrote:
>> NOTE! 8-bit increment/decrement does NOT affect the carry. Only sign or zero may be detected after those. If you use zero as the trigger for a dual 8-bit decrement loop (i.e. accomplishing a 16-bit decrement using two 8-bit decrements) you need to take into account that zero is not the same as carry and you will have to adjust your starting counts accordingly.
>
> You are right. My mistake. Using only the detection of zero a possible
> solution is doing a 16 bit decrement and for the low and high bytes
> an increment followed by a decrement. So the value of the register does
> not change but only the flags are set. A test costs 36 cycles if
> both registers have to be checked or at least 18 cycles if the low byte
> is not zero after the 16 Bit decrement.

My initial thought was to save/restore A e.g.

push h
mov l,a
mov a,e
ora d
mov a,l
pop h

but hoping there was something smarter. I later discovered a logical error
in my code and after correcting it the problem went away...

Re: 8080 question

<kiv610Fnq5U1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4355&group=comp.os.cpm#4355

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: peter.heitzer@rz.uni-regensburg.de (Peter Heitzer)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: 2 Aug 2023 14:03:12 GMT
Lines: 29
Message-ID: <kiv610Fnq5U1@mid.individual.net>
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net> <c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com> <kiuu4cFtrrqU1@mid.individual.net> <uadk3j$2hu0$1@dont-email.me>
X-Trace: individual.net UX93u99+8qWs6w1C7u1K7g/qi2ZYWmtaXIRsLslGsLoyMAgb9aT6IHZgOn
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:FEiHsWb9Cw3KL90MNMaqGODZQSA= sha256:o6ixMR67ec1uKLJT4hvHtZYzV2lMC+yfwiOiu7oRik8=
User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (Linux/4.19.0-24-amd64 (x86_64))
 by: Peter Heitzer - Wed, 2 Aug 2023 14:03 UTC

dxforth <dxforth@gmail.com> wrote:
>On 2/08/2023 9:48 pm, Peter Heitzer wrote:
>> Douglas Miller <durgadas311@gmail.com> wrote:
>>> NOTE! 8-bit increment/decrement does NOT affect the carry. Only sign or zero may be detected after those. If you use zero as the trigger for a dual 8-bit decrement loop (i.e. accomplishing a 16-bit decrement using two 8-bit decrements) you need to take into account that zero is not the same as carry and you will have to adjust your starting counts accordingly.
>>
>> You are right. My mistake. Using only the detection of zero a possible
>> solution is doing a 16 bit decrement and for the low and high bytes
>> an increment followed by a decrement. So the value of the register does
>> not change but only the flags are set. A test costs 36 cycles if
>> both registers have to be checked or at least 18 cycles if the low byte
>> is not zero after the 16 Bit decrement.

>My initial thought was to save/restore A e.g.

> push h
> mov l,a
> mov a,e
> ora d
> mov a,l
> pop h

That makes 38 cycles + 10 cycles for the jump which is more than my
suggested code but it uses less bytes and is better readable.

>but hoping there was something smarter. I later discovered a logical error
>in my code and after correcting it the problem went away...

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de

Re: 8080 question

<bjxyM.146068$bG99.39221@usenetxs.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4356&group=comp.os.cpm#4356

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx15.ams4.POSTED!not-for-mail
From: zgedneil@spam^H^H^H^Hgmail.com (Russell Marks)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net>
<c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com>
<kiuu4cFtrrqU1@mid.individual.net> <uadk3j$2hu0$1@dont-email.me>
Organization: this space intentionally left blank
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
Lines: 25
Message-ID: <bjxyM.146068$bG99.39221@usenetxs.com>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Wed, 02 Aug 2023 18:32:39 UTC
Date: Wed, 02 Aug 2023 18:32:39 GMT
X-Received-Bytes: 1367
 by: Russell Marks - Wed, 2 Aug 2023 18:32 UTC

dxforth <dxforth@gmail.com> wrote:

[Re: testing if a register pair is zero on an 8080]
>
> My initial thought was to save/restore A e.g.
>
> push h
> mov l,a
> mov a,e
> ora d
> mov a,l
> pop h
>
> but hoping there was something smarter. I later discovered a logical error
> in my code and after correcting it the problem went away...

That makes it sound like you don't need the test any more, but I may
as well still say that self-modifying code would be slightly faster:

sta aop+1
mov a,e
ora d
aop: mvi a,0

-Rus.

Re: 8080 question

<uaf1vf$fd7b$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4359&group=comp.os.cpm#4359

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: Thu, 3 Aug 2023 12:04:32 +1000
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <uaf1vf$fd7b$1@dont-email.me>
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net>
<c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com>
<kiuu4cFtrrqU1@mid.individual.net> <uadk3j$2hu0$1@dont-email.me>
<bjxyM.146068$bG99.39221@usenetxs.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 3 Aug 2023 02:04:31 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="18510595855dac202a9d679d35803752";
logging-data="505067"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3j0D17kfLLniqFJS8VbOH"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:Zu9YzXNf/G+pzezvmCWgeQaYx0s=
Content-Language: en-GB
In-Reply-To: <bjxyM.146068$bG99.39221@usenetxs.com>
 by: dxforth - Thu, 3 Aug 2023 02:04 UTC

On 3/08/2023 4:32 am, Russell Marks wrote:
> dxforth <dxforth@gmail.com> wrote:
>
> [Re: testing if a register pair is zero on an 8080]
>>
>> My initial thought was to save/restore A e.g.
>>
>> push h
>> mov l,a
>> mov a,e
>> ora d
>> mov a,l
>> pop h
>>
>> but hoping there was something smarter. I later discovered a logical error
>> in my code and after correcting it the problem went away...
>
> That makes it sound like you don't need the test any more, but I may
> as well still say that self-modifying code would be slightly faster:
>
> sta aop+1
> mov a,e
> ora d
> aop: mvi a,0

Only 2 extra instructions which makes it very clean. Must remember it
for next time!

Despite the 8080 having few registers I'm often surprised by how few
times that's been a problem.

Re: 8080 question

<37c8aa91-0b92-4360-a63f-f7181805ede4n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4361&group=comp.os.cpm#4361

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:6214:90c:b0:63c:f590:ce4c with SMTP id dj12-20020a056214090c00b0063cf590ce4cmr83213qvb.12.1691032401409;
Wed, 02 Aug 2023 20:13:21 -0700 (PDT)
X-Received: by 2002:a9d:6198:0:b0:6b9:dc90:e351 with SMTP id
g24-20020a9d6198000000b006b9dc90e351mr18407913otk.6.1691032401114; Wed, 02
Aug 2023 20:13:21 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.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: comp.os.cpm
Date: Wed, 2 Aug 2023 20:13:20 -0700 (PDT)
In-Reply-To: <uaf1vf$fd7b$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=184.65.199.217; posting-account=-IIShgoAAABn3OBN6yyn_j_cvr-dTEQg
NNTP-Posting-Host: 184.65.199.217
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net>
<c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com> <kiuu4cFtrrqU1@mid.individual.net>
<uadk3j$2hu0$1@dont-email.me> <bjxyM.146068$bG99.39221@usenetxs.com> <uaf1vf$fd7b$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <37c8aa91-0b92-4360-a63f-f7181805ede4n@googlegroups.com>
Subject: Re: 8080 question
From: mdlougheed@gmail.com (Mark Lougheed)
Injection-Date: Thu, 03 Aug 2023 03:13:21 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1590
 by: Mark Lougheed - Thu, 3 Aug 2023 03:13 UTC

8080 or 8085? If 8085, there is the undocumented instruction "DSUB" (08h), where:
HL = HL - BC (Z, S, P, CY, AC and X5, V all flag receives influence)

LXI H some number
LXI B 1
DSUB
JZ (or JNZ) somewhere

https://electronicerror.blogspot.com/2007/08/undocumented-flags-and-instructions.html

Re: 8080 question

<kj15bjFaa6mU1@mid.individual.net>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4364&group=comp.os.cpm#4364

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: peter.heitzer@rz.uni-regensburg.de (Peter Heitzer)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: 3 Aug 2023 08:04:03 GMT
Lines: 21
Message-ID: <kj15bjFaa6mU1@mid.individual.net>
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net> <c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com> <kiuu4cFtrrqU1@mid.individual.net> <uadk3j$2hu0$1@dont-email.me> <bjxyM.146068$bG99.39221@usenetxs.com> <uaf1vf$fd7b$1@dont-email.me> <37c8aa91-0b92-4360-a63f-f7181805ede4n@googlegroups.com>
X-Trace: individual.net GJulvOtUHvcJwH3I5T5l/waz6P+Ar2wNS01KNLMbhAyAdTkJrrCG2eqCMr
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:lXp2a+Wlt2jCfuju7jECuq+fSn4= sha256:U39Do0MA2EIqbTCb1uEQZw3MCxra2j8oh0rLv5p3Xfg=
User-Agent: tin/2.4.3-20181224 ("Glen Mhor") (UNIX) (Linux/4.19.0-24-amd64 (x86_64))
 by: Peter Heitzer - Thu, 3 Aug 2023 08:04 UTC

Mark Lougheed <mdlougheed@gmail.com> wrote:
>8080 or 8085? If 8085, there is the undocumented instruction "DSUB" (08h), where:
>HL = HL - BC (Z, S, P, CY, AC and X5, V all flag receives influence)

>LXI H some number
>LXI B 1
>DSUB
>JZ (or JNZ) somewhere

>https://electronicerror.blogspot.com/2007/08/undocumented-flags-and-instructions.html
In 8080:
PUSH B
LXI B 0ffffh
DAD B
POP B
JC iszero

Needs 51 cycles and the counter to be tested must be in HL.

--
Dipl.-Inform(FH) Peter Heitzer, peter.heitzer@rz.uni-regensburg.de

Re: 8080 question

<5647aefc-ec44-43f2-ac03-5243c4176480n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4392&group=comp.os.cpm#4392

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:620a:24a:b0:76a:dcfc:773a with SMTP id q10-20020a05620a024a00b0076adcfc773amr23549qkn.5.1691351671816;
Sun, 06 Aug 2023 12:54:31 -0700 (PDT)
X-Received: by 2002:a05:6870:a445:b0:1bb:5fac:524e with SMTP id
n5-20020a056870a44500b001bb5fac524emr6050799oal.5.1691351671446; Sun, 06 Aug
2023 12:54:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!panix!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.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: comp.os.cpm
Date: Sun, 6 Aug 2023 12:54:30 -0700 (PDT)
In-Reply-To: <kj15bjFaa6mU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c8:4e3e:cd01:d00:ee88:7299:d393;
posting-account=7LAplAoAAAByKIXUc8acNTC_dUp06kdO
NNTP-Posting-Host: 2a00:23c8:4e3e:cd01:d00:ee88:7299:d393
References: <uaciqs$3ured$1@dont-email.me> <kiuj4aFs47aU1@mid.individual.net>
<c12cd51a-d5eb-4477-8fa2-b8cadf3e65d1n@googlegroups.com> <kiuu4cFtrrqU1@mid.individual.net>
<uadk3j$2hu0$1@dont-email.me> <bjxyM.146068$bG99.39221@usenetxs.com>
<uaf1vf$fd7b$1@dont-email.me> <37c8aa91-0b92-4360-a63f-f7181805ede4n@googlegroups.com>
<kj15bjFaa6mU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5647aefc-ec44-43f2-ac03-5243c4176480n@googlegroups.com>
Subject: Re: 8080 question
From: ogdenpm@gmail.com (Mark Ogden)
Injection-Date: Sun, 06 Aug 2023 19:54:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2575
 by: Mark Ogden - Sun, 6 Aug 2023 19:54 UTC

On Thursday, 3 August 2023 at 09:04:06 UTC+1, Peter Heitzer wrote:
> Mark Lougheed <mdlou...@gmail.com> wrote:
> >8080 or 8085? If 8085, there is the undocumented instruction "DSUB" (08h), where:
> >HL = HL - BC (Z, S, P, CY, AC and X5, V all flag receives influence)
>
> >LXI H some number
> >LXI B 1
> >DSUB
> >JZ (or JNZ) somewhere
>
> >https://electronicerror.blogspot.com/2007/08/undocumented-flags-and-instructions.html
> In 8080:
> PUSH B
> LXI B 0ffffh
> DAD B
> POP B
> JC iszero
>
> Needs 51 cycles and the counter to be tested must be in HL.
> --
> Dipl.-Inform(FH) Peter Heitzer, peter....@rz.uni-regensburg.de
Depending on usage, one option is to pre increment the two bytes of the count as in
lxi b,count + 101h

then the test for 0 can be done with
dcr c
jnz not0
dcr b
jnz not0
; count was zero

or similar variants
e.g.
lxi b,count + 101h
loop:
do something
....
dcr c
jnz loop
dcr b
jnz loop
; all done

this can lead to quicker code as the dcr b is only done once every time the c register is zero
note if count is calculated, just do inr c, inr b

Mark

Re: 8080 question

<7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4402&group=comp.os.cpm#4402

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ac8:7f03:0:b0:401:dfc4:6f8f with SMTP id f3-20020ac87f03000000b00401dfc46f8fmr37751qtk.13.1691467880083;
Mon, 07 Aug 2023 21:11:20 -0700 (PDT)
X-Received: by 2002:a05:6808:1520:b0:3a7:9a19:332b with SMTP id
u32-20020a056808152000b003a79a19332bmr11613457oiw.7.1691467879814; Mon, 07
Aug 2023 21:11:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.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: comp.os.cpm
Date: Mon, 7 Aug 2023 21:11:19 -0700 (PDT)
In-Reply-To: <uaciqs$3ured$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=203.76.225.173; posting-account=yre5vgoAAABwuYxQiQDdGcu9SyyRYxDD
NNTP-Posting-Host: 203.76.225.173
References: <uaciqs$3ured$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>
Subject: Re: 8080 question
From: phillip.stevens@gmail.com (Phillip Stevens)
Injection-Date: Tue, 08 Aug 2023 04:11:20 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1693
 by: Phillip Stevens - Tue, 8 Aug 2023 04:11 UTC

On Wednesday, 2 August 2023, dxforth wrote:
> I have a count in a double register.
> Is there a way to decrement and test for 0 without using the A register?

If the target is 8085 then there is an undocumented flag and jump instruction available.

The flag is usually called K and I often use the JP NK instruction to emulate a z80 LDIR instruction. The K flag is set on 0 to 0xFFFF so the loop counter needs to be pre-decremented.

Usage xamples are here.
https://github.com/RC2014Z80/RC2014/blob/master/ROMs/CPM-IDE/acia85cf/cpm22preamble.asm#L34

Of course this is only going to work if your target is actually 8085.

Re: 8080 question

<uatdta$3d3jm$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4406&group=comp.os.cpm#4406

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: Tue, 8 Aug 2023 22:54:02 +1000
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <uatdta$3d3jm$1@dont-email.me>
References: <uaciqs$3ured$1@dont-email.me>
<7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 8 Aug 2023 12:54:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ffb73633e28fe7e90650d76b2ea90b96";
logging-data="3575414"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NJWCpGpgiPUq8QOz5P5gD"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:pF5uHlF/UcBerpV7COMg4NDA2XM=
In-Reply-To: <7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>
Content-Language: en-GB
 by: dxforth - Tue, 8 Aug 2023 12:54 UTC

On 8/08/2023 2:11 pm, Phillip Stevens wrote:
> On Wednesday, 2 August 2023, dxforth wrote:
>> I have a count in a double register.
>> Is there a way to decrement and test for 0 without using the A register?
>
> If the target is 8085 then there is an undocumented flag and jump instruction available.
>
> The flag is usually called K and I often use the JP NK instruction to emulate a z80 LDIR instruction. The K flag is set on 0 to 0xFFFF so the loop counter needs to be pre-decremented.
>
> Usage xamples are here.
> https://github.com/RC2014Z80/RC2014/blob/master/ROMs/CPM-IDE/acia85cf/cpm22preamble.asm#L34
>
> Of course this is only going to work if your target is actually 8085.

A pity Intel didn't seriously look at an extended instruction set.
Why Faggin left?

Re: 8080 question

<f7086dc3-e800-4bd9-b525-24a569ee9478n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4414&group=comp.os.cpm#4414

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a05:622a:1887:b0:403:a6db:42ad with SMTP id v7-20020a05622a188700b00403a6db42admr15469qtc.9.1691532626681;
Tue, 08 Aug 2023 15:10:26 -0700 (PDT)
X-Received: by 2002:a05:6830:1309:b0:6b9:b8fd:9ebb with SMTP id
p9-20020a056830130900b006b9b8fd9ebbmr273918otq.4.1691532626292; Tue, 08 Aug
2023 15:10:26 -0700 (PDT)
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.blueworldhosting.com!diablo1.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: comp.os.cpm
Date: Tue, 8 Aug 2023 15:10:25 -0700 (PDT)
In-Reply-To: <uatdta$3d3jm$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=203.76.225.173; posting-account=yre5vgoAAABwuYxQiQDdGcu9SyyRYxDD
NNTP-Posting-Host: 203.76.225.173
References: <uaciqs$3ured$1@dont-email.me> <7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>
<uatdta$3d3jm$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <f7086dc3-e800-4bd9-b525-24a569ee9478n@googlegroups.com>
Subject: Re: 8080 question
From: phillip.stevens@gmail.com (Phillip Stevens)
Injection-Date: Tue, 08 Aug 2023 22:10:26 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2221
 by: Phillip Stevens - Tue, 8 Aug 2023 22:10 UTC

On Tuesday, 8 August 2023 at 22:54:05 UTC+10, dxforth wrote:
> On 8/08/2023 2:11 pm, Phillip Stevens wrote:
> > Of course this is only going to work if your target is actually 8085.

> A pity Intel didn't seriously look at an extended instruction set.

A bit OT but since you asked. The enhancements Intel made to the 8085, and then decided not to support, made the 8085 almost perfect imho. Undocumented stack access using DE instructions is much faster than IX/IY in the z80, and the 16 bit rotations really accelerated math (given no hardware multiply).

Using these enhancements, and a “native” C compiler, the 8085 actually beats the z80 in some of our z88dk benchmarks.

So one excellent code table (256) of instructions is a pretty nice design.
https://feilipu.me/2021/09/27/8085-software/

> Why Faggin left?

Wasn’t there, but I guess it is easier to get rich working for yourself. 😊
Something he perhaps wouldn’t have achieved at Intel.

Re: 8080 question

<uautvp$3o5kk$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4417&group=comp.os.cpm#4417

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: Wed, 9 Aug 2023 12:34:34 +1000
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <uautvp$3o5kk$1@dont-email.me>
References: <uaciqs$3ured$1@dont-email.me>
<7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>
<uatdta$3d3jm$1@dont-email.me>
<f7086dc3-e800-4bd9-b525-24a569ee9478n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 9 Aug 2023 02:34:34 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="f0dab27eceaa0d118c507e5f56d13026";
logging-data="3937940"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX198ZU/l5uFztgkfKMwK1Qji"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:4iem9rJ+X4blQxOgx1QBfasIjvE=
Content-Language: en-GB
In-Reply-To: <f7086dc3-e800-4bd9-b525-24a569ee9478n@googlegroups.com>
 by: dxforth - Wed, 9 Aug 2023 02:34 UTC

On 9/08/2023 8:10 am, Phillip Stevens wrote:
> On Tuesday, 8 August 2023 at 22:54:05 UTC+10, dxforth wrote:
>> On 8/08/2023 2:11 pm, Phillip Stevens wrote:
>>> Of course this is only going to work if your target is actually 8085.
>
>> A pity Intel didn't seriously look at an extended instruction set.
>
> A bit OT but since you asked. The enhancements Intel made to the 8085, and then decided not to support, made the 8085 almost perfect imho. Undocumented stack access using DE instructions is much faster than IX/IY in the z80, and the 16 bit rotations really accelerated math (given no hardware multiply).
>
> Using these enhancements, and a “native” C compiler, the 8085 actually beats the z80 in some of our z88dk benchmarks.
>
> So one excellent code table (256) of instructions is a pretty nice design.
> https://feilipu.me/2021/09/27/8085-software/

I assumed any undoc instructions would be either side-effects or planned but
broken in some way. From what you say this doesn't appear to be the case here.
Sounds like it was an executive decision to leave them out. Unfortunately the
result is the same - software that uses undoc instructions have a certain odour
to them.

>> Why Faggin left?
>
> Wasn’t there, but I guess it is easier to get rich working for yourself. 😊
> Something he perhaps wouldn’t have achieved at Intel.

Though for creative folk leaving tends to be more about frustration. For Intel
execs it would have been about where best to invest their money.

Re: 8080 question

<1c696473-10a6-4d91-8b6d-d4bf57970555n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4427&group=comp.os.cpm#4427

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ac8:67ce:0:b0:40a:9069:895b with SMTP id r14-20020ac867ce000000b0040a9069895bmr142767qtp.2.1691850837685;
Sat, 12 Aug 2023 07:33:57 -0700 (PDT)
X-Received: by 2002:a17:902:d505:b0:1bb:9e6e:a9f1 with SMTP id
b5-20020a170902d50500b001bb9e6ea9f1mr1855231plg.13.1691850837032; Sat, 12 Aug
2023 07:33:57 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: comp.os.cpm
Date: Sat, 12 Aug 2023 07:33:56 -0700 (PDT)
In-Reply-To: <uautvp$3o5kk$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=203.76.225.173; posting-account=yre5vgoAAABwuYxQiQDdGcu9SyyRYxDD
NNTP-Posting-Host: 203.76.225.173
References: <uaciqs$3ured$1@dont-email.me> <7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>
<uatdta$3d3jm$1@dont-email.me> <f7086dc3-e800-4bd9-b525-24a569ee9478n@googlegroups.com>
<uautvp$3o5kk$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1c696473-10a6-4d91-8b6d-d4bf57970555n@googlegroups.com>
Subject: Re: 8080 question
From: phillip.stevens@gmail.com (Phillip Stevens)
Injection-Date: Sat, 12 Aug 2023 14:33:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2526
 by: Phillip Stevens - Sat, 12 Aug 2023 14:33 UTC

> > Using these enhancements, and a “native” C compiler, the 8085 actually beats the z80 in some of our z88dk benchmarks.
> >
> > So one excellent code table of (256) instructions is a pretty nice design.
> > https://feilipu.me/2021/09/27/8085-software/
> I assumed any undoc instructions would be either side-effects or planned but
> broken in some way. From what you say this doesn't appear to be the case here.
> Sounds like it was an executive decision to leave them out. Unfortunately the
> result is the same - software that uses undoc instructions have a certain odour
> to them.

I wouldn’t worry too much. Tundra Semiconductor licensed the 80c85 design and published them as “enhanced instructions” in their datasheet. Complete with their own mistakes and mis interpretation.

http://images.100y.com.tw/pdf_file/34-TUNDRA-CA80C85B.pdf

Ken Shirriff covers the reverse engineering in some details and corrects the error in the Tundra datasheet.
His whole series is great reading on the 8085.

http://www.righto.com/2013/02/looking-at-silicon-to-understanding.html?m=1

So safe to use with no hesitation or odour. :-)

Re: 8080 question

<59d24b8d-aec5-4917-b2f9-fa79b1c6162bn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4428&group=comp.os.cpm#4428

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:a37:b405:0:b0:762:3d49:c90e with SMTP id d5-20020a37b405000000b007623d49c90emr62633qkf.6.1691866677074;
Sat, 12 Aug 2023 11:57:57 -0700 (PDT)
X-Received: by 2002:a17:902:db08:b0:1b8:91ad:79e1 with SMTP id
m8-20020a170902db0800b001b891ad79e1mr2251593plx.11.1691866676599; Sat, 12 Aug
2023 11:57:56 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.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: comp.os.cpm
Date: Sat, 12 Aug 2023 11:57:55 -0700 (PDT)
In-Reply-To: <uaciqs$3ured$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=24.80.80.87; posting-account=tJX0kAoAAACxHvEUAb7F6FVw4XmLeIbL
NNTP-Posting-Host: 24.80.80.87
References: <uaciqs$3ured$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <59d24b8d-aec5-4917-b2f9-fa79b1c6162bn@googlegroups.com>
Subject: Re: 8080 question
From: gp2k00@gmail.com (George Phillips)
Injection-Date: Sat, 12 Aug 2023 18:57:57 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2105
 by: George Phillips - Sat, 12 Aug 2023 18:57 UTC

If you're willing to alter the count you can do the 16 bit loop as two 8 bit tests which will be faster. For example, suppose your 16 bit loop count is in DE. This code will execute the loop DE times:

; transform DE to split count
dcx d
inr d
inr e
loop:
; ... processing here
dcr e
jnz loop
dcr d
jnz loop

To see how it works consider the two cases going in where E is zero and not zero. Or, equivalently, when DE is a exact multiple of 256 or not. Note that the value of E never changes. If E is not zero then 1 is added to D. The inner loop will do E iterations and then after that it will do 256 iterations D times (the original value of D). Check it with $0003 and $0103 to get the idea.

If E is zero then D is not altered either. The inner loop will always be 256 iterations and will be executed D times. Checking $0100 and $0000 will show the correctness. Like with a conventional 16 bit loop, $0000 means 65536 iterations.

Re: 8080 question

<ub9fgu$1id9l$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4429&group=comp.os.cpm#4429

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: Sun, 13 Aug 2023 12:35:12 +1000
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <ub9fgu$1id9l$1@dont-email.me>
References: <uaciqs$3ured$1@dont-email.me>
<7c7827b6-f66c-42e3-a199-ebf8b3ab8b04n@googlegroups.com>
<uatdta$3d3jm$1@dont-email.me>
<f7086dc3-e800-4bd9-b525-24a569ee9478n@googlegroups.com>
<uautvp$3o5kk$1@dont-email.me>
<1c696473-10a6-4d91-8b6d-d4bf57970555n@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Aug 2023 02:35:11 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4e83c4580745025ef8b2b034777136a0";
logging-data="1652021"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wON+8hPdEeX38yMW6kQpu"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:Z/MYCZGwkyKx7jemcenWAemckMc=
In-Reply-To: <1c696473-10a6-4d91-8b6d-d4bf57970555n@googlegroups.com>
Content-Language: en-GB
 by: dxforth - Sun, 13 Aug 2023 02:35 UTC

On 13/08/2023 12:33 am, Phillip Stevens wrote:
>>> Using these enhancements, and a “native” C compiler, the 8085 actually beats the z80 in some of our z88dk benchmarks.
>>>
>>> So one excellent code table of (256) instructions is a pretty nice design.
>>> https://feilipu.me/2021/09/27/8085-software/
>> I assumed any undoc instructions would be either side-effects or planned but
>> broken in some way. From what you say this doesn't appear to be the case here.
>> Sounds like it was an executive decision to leave them out. Unfortunately the
>> result is the same - software that uses undoc instructions have a certain odour
>> to them.
>
> I wouldn’t worry too much. Tundra Semiconductor licensed the 80c85 design and published them as “enhanced instructions” in their datasheet. Complete with their own mistakes and mis interpretation.
>
> http://images.100y.com.tw/pdf_file/34-TUNDRA-CA80C85B.pdf
>
> Ken Shirriff covers the reverse engineering in some details and corrects the error in the Tundra datasheet.
> His whole series is great reading on the 8085.
>
> http://www.righto.com/2013/02/looking-at-silicon-to-understanding.html?m=1
>
> So safe to use with no hesitation or odour. :-)

Intel gave Tundra license to reproduce the silicon. Publishing undoc instructions
that were never their own, not industry standard, and unbelievably - screwing it
up - might give some customers pause to think. Marketing gimmick gone wrong?

Re: 8080 question

<ub9g78$1mijp$1@dont-email.me>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4430&group=comp.os.cpm#4430

  copy link   Newsgroups: comp.os.cpm
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dxforth@gmail.com (dxforth)
Newsgroups: comp.os.cpm
Subject: Re: 8080 question
Date: Sun, 13 Aug 2023 12:47:05 +1000
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ub9g78$1mijp$1@dont-email.me>
References: <uaciqs$3ured$1@dont-email.me>
<59d24b8d-aec5-4917-b2f9-fa79b1c6162bn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Aug 2023 02:47:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4e83c4580745025ef8b2b034777136a0";
logging-data="1788537"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/oa+UWp9jfKgKJwbjZRUEp"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:GGBqw2TRJLkV+PlXIJ/I7DAwRxk=
Content-Language: en-GB
In-Reply-To: <59d24b8d-aec5-4917-b2f9-fa79b1c6162bn@googlegroups.com>
 by: dxforth - Sun, 13 Aug 2023 02:47 UTC

On 13/08/2023 4:57 am, George Phillips wrote:
> If you're willing to alter the count you can do the 16 bit loop as two 8 bit tests which will be faster. For example, suppose your 16 bit loop count is in DE. This code will execute the loop DE times:
>
> ; transform DE to split count
> dcx d
> inr d
> inr e
> loop:
> ; ... processing here
> dcr e
> jnz loop
> dcr d
> jnz loop
>
> To see how it works consider the two cases going in where E is zero and not zero. Or, equivalently, when DE is a exact multiple of 256 or not. Note that the value of E never changes. If E is not zero then 1 is added to D. The inner loop will do E iterations and then after that it will do 256 iterations D times (the original value of D). Check it with $0003 and $0103 to get the idea.
>
> If E is zero then D is not altered either. The inner loop will always be 256 iterations and will be executed D times. Checking $0100 and $0000 will show the correctness. Like with a conventional 16 bit loop, $0000 means 65536 iterations.

Also ROMable

Re: 8080 question

<b7ddafab-f0a8-421a-9fdc-0ddc33f71d1fn@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=4437&group=comp.os.cpm#4437

  copy link   Newsgroups: comp.os.cpm
X-Received: by 2002:ad4:56f1:0:b0:63f:7ee4:e9d1 with SMTP id cr17-20020ad456f1000000b0063f7ee4e9d1mr85050qvb.5.1691940541133;
Sun, 13 Aug 2023 08:29:01 -0700 (PDT)
X-Received: by 2002:a17:903:41c5:b0:1b9:fef8:9af1 with SMTP id
u5-20020a17090341c500b001b9fef89af1mr3038241ple.5.1691940540860; Sun, 13 Aug
2023 08:29:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.cpm
Date: Sun, 13 Aug 2023 08:29:00 -0700 (PDT)
In-Reply-To: <59d24b8d-aec5-4917-b2f9-fa79b1c6162bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa;
posting-account=7LAplAoAAAByKIXUc8acNTC_dUp06kdO
NNTP-Posting-Host: 2a00:23c8:4e3e:cd01:3538:55b9:4dab:36fa
References: <uaciqs$3ured$1@dont-email.me> <59d24b8d-aec5-4917-b2f9-fa79b1c6162bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b7ddafab-f0a8-421a-9fdc-0ddc33f71d1fn@googlegroups.com>
Subject: Re: 8080 question
From: ogdenpm@gmail.com (Mark Ogden)
Injection-Date: Sun, 13 Aug 2023 15:29:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 39
 by: Mark Ogden - Sun, 13 Aug 2023 15:29 UTC

On Saturday, 12 August 2023 at 19:57:57 UTC+1, George Phillips wrote:
> If you're willing to alter the count you can do the 16 bit loop as two 8 bit tests which will be faster. For example, suppose your 16 bit loop count is in DE. This code will execute the loop DE times:
>
> ; transform DE to split count
> dcx d
> inr d
> inr e
> loop:
> ; ... processing here
> dcr e
> jnz loop
> dcr d
> jnz loop
>
> To see how it works consider the two cases going in where E is zero and not zero. Or, equivalently, when DE is a exact multiple of 256 or not. Note that the value of E never changes. If E is not zero then 1 is added to D. The inner loop will do E iterations and then after that it will do 256 iterations D times (the original value of D). Check it with $0003 and $0103 to get the idea.
>
> If E is zero then D is not altered either. The inner loop will always be 256 iterations and will be executed D times. Checking $0100 and $0000 will show the correctness. Like with a conventional 16 bit loop, $0000 means 65536 iterations.
If a count of zero is valid, then the tests need to be moved to the start of the loop
; de = count
inr d ; or lxi d, count + 101h
inr e
endtest:
dcr e
jnz loop
dcr d
jz done
loop:
; processing here
jmp endtest

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor