Newsgroups: comp.sys.transputer
From: jan@neuroinformatik.ruhr-uni-bochum.de (Jan Vorbrueggen)
Subject: Re: Transputer cj instruction
Organization: Institut fuer Neuroinformatik, Ruhr-Universitaet Bochum, Germany
Date: 06 Apr 94 11:46:14 GMT
Message-ID: <JAN.94Apr6124614@thalia.neuroinformatik.ruhr-uni-bochum.de>

In article <2nmmrg$1jg@lyra.csx.cam.ac.uk> 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?

Well, I asked that quaestion a few years ago, and the answer was "to support
short-cut evaluation of logical expressions" (where you know an OR is TRUE if
the first expression evaluates as TRUE, and similar for AND). However, I think
they still got it wrong (it's alright that it's asymmetrical, because you have
limited opcode space): throwing away an unknown quantity is somewhat stupid,
you can always reconstruct the zero the current definition is discarding.

	Jan

