Newsgroups: comp.sys.transputer
From: aph@cam-orl.co.uk (Andrew Haley)
Subject: Re: Transputer cj instruction
Organization: Olivetti Research Ltd, Cambridge, England.
Date: 5 Apr 1994 18:34:32 GMT
Message-ID: <2nsavo$t4v@lyra.csx.cam.ac.uk>

Steffen Seeger (seeger@physik.tu-chemnitz.de) wrote:
: aph@cam-orl.co.uk (Andrew Haley) writes:

: >The cj instruction is a jump if false; it jumps if Areg is zero.  The
: >odd thing is that if the branch is not taken, Areg is discarded; if
: >the branch is taken, Areg is not discarded.  This has been giving me
: >considerable headaches, both in writing assembly code and code
: >generation.  Does any reader of this newsgroup understand why the cj
: >instruction does this?

: >Andrew.

: May be thats because it gives you a simple possibility to check (channel)
: pointers. If it is a NIL (=0) one, you jump over the code (eg in a repeated
: alt construct) and if not you need not to reload the pointer. 

But the cj instruction is the _other way around_.  It would make
perfect sense to only toss away the contents of Areg if it was zero,
but the Transputer does exactly the opposite.  I think that this is a
bug which has been frozen into the architecture, but am willing to be
persuaded otherwise.

Cheers, Andrew.


