[LispM-Hackers] Bug in SSDN2 Macroinstruction Notes

Nyef nyef@softhome.net
Mon, 7 Jan 2002 19:33:15 -0500 (EST)


On 7 Jan 2002, James A. Crippen wrote:

> Nyef <nyef@softhome.net> writes:
>
> > I believe that you will find that the bug is an off-by-one error in the
> > ASCII-art for the diagram for the case of a MAINOP with a base register
> > value of 3 on page 20-3. The offset field on a MAINOP is 6 bits <5:0> and
> > the base field is 3 <8:6>, leaving 7 bits <15:9> for the opcode.
> > Everything else appears to be consistant with this interpretation.
>
> That's exactly what I needed to hear.  I was looking at the constants
> in def-elroy.lisp and they weren't matching up with what I had
> supposed.  Your comment is reassuring.
>
> I think that the diagram for auxops is wrong.  Given that mainops have
> 7 bits of opcode, the various flavors of auxop should only have 7
> constant zeros, not 8.  So for auxops the <15:9> field should be zero,
> but bit 8 is part of the auxop number.  This would explain why auxops
> with a count have the 8 bit set -- to differentiate them from the
> other auxops.

I'm going to have to suggest that SSDN2, Figure 20-6 clearly shows that
the <15:9> field for all AUX-OPs is 0 and that bit 8 is part of the auxop
number.

I also find it plausible that the microcode dispatches first on the <15:9>
field (thus covering all mainops, calls, AREFI, and so on in the general
case, and then the handler for auxops further dispatches on <8:5> to catch
the cases of flow-control (complex call and long branch), counted
instructions, and everything else. I'll have to look at the actual
instruction breakdown to see if this remains plausible given what falls
into the "everything else" category (and what else gets caught in the flow
control category).

If you really want a bug in SSDN2, page 5-12 is missing from the PS up on
kappa.

> I'm going to go ahead and adjust the sources accordingly.  There are
> only a few spots that need fixing, I think.
>
> Does anybody know what to make of UCODE;LROY-TEMPLATES.LISP?
> Certainly these are the field templates, and what we should be working
> from.  But where the hell are MAKE-TEMPLATE and MAKE-PARSE defined?  I
> can't find them anywhere in my sources.  Does anyone with an Explorer
> wish to grep their system for those two functions?  I'd like to know
> what they do and particularly how to interpret their arguments.
> '(nil nil ((0 2 1))) doesn't make much sense to me.

I find that much of the ucode directory is missing context. I suspect that
many of the files there are supposed to be used with the various tools for
generating the system that we just don't have. There are constant
references to interesting-sounding codenames, mentions of "GENASYS" or
something like that, and so on.

Oh, and all those templates appear to be for the bitfield <x:6> of the
instruction, for x = 8 or 10 (8 usually, 10 for call destinations), and
the numbers after the two nils are the values for the bitfields.

> The one nice thing I noticed in lroy-templates.lisp was that most of
> the three insn groups can be subdivided into smaller groups.  Now what
> we need to know is how to determine what bits are used to separate
> them.  (The auxop groups are pretty obvious though.)

Shouldn't be too hard, at least for some of them... I'll see what I can
come up with.

The auxop groups being obvious ties in to what I said above about
instruction decoding.

> Oh, and what the heck are FORWARD and BACK supposed to mean for branch
> instructions?  Whether they branch to an offset less than the current
> PC?  Huh?

Yes, that's exactly what they are. Compare the template for the branch
ops to the template for immed ops and you'll see.

> 'james

---------------------------
All programming can be viewed as an exercise.
---------------------------
Alastair Bridgewater
e-mail: nyef@softhome.net