home .. forth .. misc mail list archive ..

Re: MISC-d Digest V99 #70


At 06:16 PM 07/12/99 +0100, Keith Wootten wrote:
>
>ShBoom II (PSC1000) can only branch to (32bit) cell boundaries, and not
>to arbitrary byte opcodes.  The branch instruction includes the branch
>as a literal, and can be 1 2 3 or 4 bytes long, depending on its
>position in the instruction group.

That's true for the pc-relative branches and calls ONLY.

The call & branch opcodes which use the top-of-stack as the address, the
return opcode, and the single-step opcode can all transfer to ANY byte
within the cell. This is complicated further by having to keep track of how
many '32-bit literal' opcodes there were (so the correct 'next address' is
used) and whether there is a byte literal within the cell (which must not
be executed).

A while back I called all of this stuff 'brain-damaged' in the context of
Chuck's original shBOOM design. It sure adds cycles! And the decode is
horrendous, lengthing the cycle time! But it does make it possible to write
pretty good compilers, allowing most people to focus on the application.

Don't expect me to make any moral judgements here--I don't think that the
chip's complexity is evil, nor do I think Chuck's wrong for wanting the
SYSTEM to be as simple as it can be. I strongly believe that tellling
non-Forth programmers that they're wrong (and bad) for not using Forth is
not a viable way to increase the number of Forth programmers (at least in
the existing US culture).

-John