Special form of ROL and ROR spin instruction with arbitrary length rotate distance?
Duane C. Johnson
Posts: 955
Hi guys;
Anybody have a spin snippet for implementing a variable distance rotate?
The standard spin ROL or ROR only works on the ends of a 32 bit long.
I would like to supply a variable that contains values of 2 to 32 to control the shifts..
I assume one end of the rotate is bit 0.
Extra points for the SHL SHR SAL SAR versions. (Ya I know SAR doesn't exist.)
Even more points if both ends of the shifts can be specified.
Any references or examples?
Thanks guys!!
Duane J
Anybody have a spin snippet for implementing a variable distance rotate?
The standard spin ROL or ROR only works on the ends of a 32 bit long.
I would like to supply a variable that contains values of 2 to 32 to control the shifts..
I assume one end of the rotate is bit 0.
Extra points for the SHL SHR SAL SAR versions. (Ya I know SAR doesn't exist.)
Even more points if both ends of the shifts can be specified.
Any references or examples?
Thanks guys!!
Duane J
Comments
I apologize for my slow acknowledgment.
I just got to the point where I am trying to use your code.
I can't get it to work. I was assuming the use of DIRB was a trick in my Prop I, which doesn't have a "B" port.
I can't use DIRA as my "A" port is being used.
My manual dosn't say I can use the "double dot", "..", operator with regular variables.
Am I missing something?
BTW, I'm attempting to add your ROXN command as an extension to the DongleBasic instruction set.
Thanks!
Duane J
POC (demoboard or quickstart) Alternatively just post the code section which handles your new command and we go from there.