Re: hp42s ROT XY function Message #3 Posted by John Limpert on 27 Sept 2007, 4:30 a.m., in response to message #1 by joe santavicca
What are you having trouble with? I looked it up in the manual and it does a standard rotate left or rotate right on a 36-bit number. If you look at the y-register as an array of 36 bits, where index 0 is the least-significant-bit and index 35 is the most significant bit, and the x-register contains 1, then:
t = y[0]
y[0] = y[1]
y[1] = y[2]
...
y[33] = y[34]
y[34] = y[35]
y[35] = t
That was a rotate right by one bit. You can think of it as a circular shift-register where the most-significant-bit is connected to the least-significant-bit.
|