From: "Duffy Nightingale" <du...@soundsoftware.us> Sent: Sunday, 4 August 2013 2:46 PM
Working on a project that requires me to build a long bit string in storage - initialized to binary 0’s. Have a need to keep concatenating bits to this string as the process continues. The len of the bit strings to add are 4, 7, 10 and possibly others. I came up with the idea of lining up on the 4 byte boundary of where I want to add. Then get the bits I want to add in the r.h. side of a register with the bits on l.h. side set to 0’s. Then OR to the left most 4 byte boundary. I know this will work but wondering if anyone out there could come up with a more straight forward elegant way to do this? Unfortunately I cannot use the latest and greatest instructions :(
What about the following?: Assuming that you have k, the number of (empty) bits remaining in the current byte, and that you have the bits to be added somewhere in another register, adjust the bits to be added until they are left-adjusted in an odd-numbered register. Then double shift left by k bits. Then do an OI using EX to put in those k bits. Then double left shift again, this time by 8 bits and OI using EX. Continue thus if there are more bits....