Shifts on 4-D

Mike Muuss mike at BRL.ARPA
Thu May 19 12:52:19 AEST 1988


I just discovered that on the SGI 4-D, negative shifts on (at least)
variables declared "register unsigned" don't work.  It would appear that
perhaps such a shift is being interpreted as a large positive shift.
At any rate, the values always came up zero in the low byte.

I wouldn't ordinarily write code that does this sort of thing -- this
particular piece of code was something that somebody else had written
quite a while ago, and I just chose this evening to port it to the 4-D.
On the other hand, the VAX and the Gould and probably many other machines
all permit negative shifts, so this seems like something that other
folks may encounter.

K&R are silent on this point (ref: pages 44, 189).  No help there.
So, I'm not asking that this be fixed, just surfacing it as an issue for
others to watch out for.

The upshot of this is that CAT-FB (a port of Ron Natalie's ICAT program)
now runs on the 4D, and very quickly.  It takes TROFF output and "typesets"
it into the current framebuffer, using the vfont bitmaps.  Very nice
for making slides.
	-Mike



More information about the Comp.sys.sgi mailing list