Article View: comp.os.linux.misc
Article #2113Re: [OT] Dead DEC Punch card times (was Re: Taking Speedy too seriously)
From: Carlos E. R.
Date: Sat, 07 Nov 2026 00:12
Date: Sat, 07 Nov 2026 00:12
55 lines
3390 bytes
3390 bytes
On 2026-11-06 21:53, Lawrence D’Oliveiro wrote:
> On Fri, 6 Nov 2026 14:30:35 +0100, Carlos E. R. wrote:
>
>> On 2026-11-06 00:17, Lawrence D’Oliveiro wrote:
>>>
>>> Here’s one trivia question: the decrement-and-branch instruction
>>> would fall out of the loop when the count reached -1, not 0 as the
>>> equivalent instruction in nearly every other computer architecture
>>> did. Why?
>>
>> Mmm. I don't remember. A flag went up?
>
> It was quite a clever feature, which I think ended up widely
> misunderstood. Otherwise more architectures would have copied it.
>
> The reason is, so that if the loop count was zero, you could just
> fall out of the loop automatically, without having to do an explicit
> test for that case.
>
> Example skeleton loop: (remember, the loop count was only 16 bits):
>
> move.w «loop-count», dN ; dN = some convenient d-register
> bra loop_bottom
> loop_top:
> ... body of loop ...
> loop_bottom:
> dbra dN, loop_top
> ... here on loop end ...
>
> Notice this will loop exactly «loop-count» times, even if «loop-count»
> is zero.
>
> If you want a 32-bit loop count, it only took a few more instructions:
>
> move.l «loop-count», dN
> bra loop_bottom
> loop_top1:
> swap dN
> loop_top2:
> ... body of loop ...
> loop_bottom:
> dbra dN, loop_top2
> swap dN
> dbra dN, loop_top1
> ... here on loop end ...
>
> (This is all from memory, it’s been a long while since I wrote any
> 68000-family assembler.)
Last time I touched it, was 1992. :-(
--
Cheers,
Carlos E.R.
ES🇪🇸, EU🇪🇺.
Technical Details
Message-ID:
<nl78o0FplcsU4@mid.individual.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailReferences:
<18dee4b6cab427fa$865$2574533$802601b3@news.usenetexpress.com> <ayudnc43iJgfVXr3nZ2dnZfqn_adnZ2d@giganews.com> <11c8mg3$2e89e$2@kst.eternal-september.org> <_ZucnafJTvBFc3r3nZ2dnZfqnPGdnZ2d@giganews.com> <11c8rq9$1e6t$1@gal.iecc.com> <nkqj0vFftq4U8@mid.individual.net> <URVFS.20180$1WK1.4115@fx14.ams4> <nkqpvsFftq4U9@mid.individual.net> <%Y_FS.30812$Gsmc.9148@fx17.ams4> <nks7oaF2rmsU2@mid.individual.net> <20261103155316.609@kylheku.com> <BRedndRyj8uMNnf3nZ2dnZfqnPSdnZ2d@giganews.com> <20261105095148.000026b0@gmail.com> <nl42ntF2rmsU25@mid.individual.net> <20261105121255.00003b4b@gmail.com> <1j6dnU7499aecXH3nZ2dnZfqn_WdnZ2d@giganews.com> <11cirsg$1votj$9@dont-email.me> <nl4afqFaf1bU7@mid.individual.net> <11cj2r4$22bch$7@dont-email.me> <nl633rFl7kmU2@mid.individual.net> <11cleon$2sgsp$3@dont-email.me>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Carlos E. R." <robin_listas@es.invalid> Newsgroups: comp.os.linux.misc,alt.folklore.computers Subject: Re: [OT] Dead DEC Punch card times (was Re: Taking Speedy too seriously) Date: Sat, 7 Nov 2026 01:12:48 +0100 Lines: 55 Message-ID: <nl78o0FplcsU4@mid.individual.net> References: <18dee4b6cab427fa$865$2574533$802601b3@news.usenetexpress.com> <ayudnc43iJgfVXr3nZ2dnZfqn_adnZ2d@giganews.com> <11c8mg3$2e89e$2@kst.eternal-september.org> <_ZucnafJTvBFc3r3nZ2dnZfqnPGdnZ2d@giganews.com> <11c8rq9$1e6t$1@gal.iecc.com> <nkqj0vFftq4U8@mid.individual.net> <URVFS.20180$1WK1.4115@fx14.ams4> <nkqpvsFftq4U9@mid.individual.net> <%Y_FS.30812$Gsmc.9148@fx17.ams4> <nks7oaF2rmsU2@mid.individual.net> <20261103155316.609@kylheku.com> <BRedndRyj8uMNnf3nZ2dnZfqnPSdnZ2d@giganews.com> <20261105095148.000026b0@gmail.com> <nl42ntF2rmsU25@mid.individual.net> <20261105121255.00003b4b@gmail.com> <1j6dnU7499aecXH3nZ2dnZfqn_WdnZ2d@giganews.com> <11cirsg$1votj$9@dont-email.me> <nl4afqFaf1bU7@mid.individual.net> <11cj2r4$22bch$7@dont-email.me> <nl633rFl7kmU2@mid.individual.net> <11cleon$2sgsp$3@dont-email.me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net Eta4jLB2xLZSg6n1zSMGHw851yNpMp6OIb2ramwNItgsalOpFB Cancel-Lock: sha1:+HJzN+P8GgCYz8zvbGzAxu+B44s= sha256:jIsoZCq5LZcVVh7gXLA2Kd6fV8/EOgnlKJ5Q0pDFLkE= User-Agent: Mozilla Thunderbird Content-Language: en-GB In-Reply-To: <11cleon$2sgsp$3@dont-email.me>