PASM gurus - bit matrix transform challenge
MJB
Posts: 1,235
in Propeller 1
In COG I have a bit-matrix 32*8 = 8 consecutive longs
I want to populate them with data from a 32 byte HUB array
in a way, that each byte fills the same bit position in the COG bit-matrix
so first byte ends up in bit position 0 of all 8 longs
and 32nd byte ends up in bit position 31 of all longs
any neat tricks out there?
thanks
MJB
I want to populate them with data from a 32 byte HUB array
in a way, that each byte fills the same bit position in the COG bit-matrix
so first byte ends up in bit position 0 of all 8 longs
and 32nd byte ends up in bit position 31 of all longs
any neat tricks out there?
thanks
MJB
Comments
good - was thinking of using MUXC to set the values - but shifting RCR in is good thought ... saves the extra mask and shifting it
muxing would give some flexibility if I wanted to insert the byte at random positions into the matrix.
shouldn't your ?? or what do I miss?
You could do it with:
After 32 bytes, the bits would be in the correct position. The muxc solution is elegant, though. That's one of those instructions that I never use, but probably should be.
You have no initial value for your mask. And the mask just isn't necessary.
No, I was saying your approach was good. It just needed RCL instead of RCR.