On 2022-02-08 00:15, Thomas DeBellis wrote:
I remember taking a course in systems architecture
from an IBM'er when
he pointed out that, based on their measurements and sampling,
arithmetic wasn't as big a portion of the instruction mix as might
commonly be thought. He said, "Computers don't add. What computers do
is branch." (IBM lingo for a jump or a change of PC). It was one of
those eye opening moments.
Well, branches are definitely important. But computers do a lot of just
moving data around as well. Which sometimes is one of those times when
the condition codes helps. If you want to move until some condition, you
might be lucky that this condition can be easily detected without any
extra instructions. Such as moving something until you hit a NUL... :-)
So, Yes, you are going to have a bunch a jumps,
it's really about how
they get hit.
Yup.
I found doing a compare and conditional jump nice, but
perhaps that's
because this is how the x86 does unsigned arithmetic, which the 10
doesn't really have.
On the PDP-11 condition codes for both signed and unsigned conditions
are generated all the time, so it becomes a question of just picking the
right type of conditional branch.
I think the only time skips ever get confusing for me
is when you want
to transfer execution based on a bunch of bits all being on. You can
test for them all being off (TxnE), but the corresponding test (TxnN)
skips if *any* of them are on. So that means you have to complement the
bits (TRC, say) then test them for being off while complementing them
back again.
Yeah. That's always one of those annoying things. Another way is to mask
out the interesting bits and compare to the expected value. But it's
additional instructions anyway. The problem exists in the same way on
the PDP-11.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol