Hi All, I browsed the PICList source library, but couldn't find anything similar to what I was looking for. I have a buffer of "packed" "bytes" where each byte is less that 8-bits in length. This buffer is generated by capturing a bitstream (LSB first) and right shifting in to the LSB of a buffer. e.g. for bytes sized 7 bits, if the first byte is all ones, the second is all zeros, and the third is all ones, my buffer looks as such: 01111111 11000000 xxx11111 xxxxxxxx ... What I would like to do is break each "byte" out of the buffer and put it into another buffer, e.g. 01111111 00000000 01111111 0xxxxxxx 0xxxxxxx ... I've started writing a function (in C) to do this, but I was wondering if anyone had anything similar (no need for me to reinvent the wheel). Ideally, I was going to create a generic C function that would take as parameters the input and output buffer pointers, length of the input buffer, the size of each "byte," and where to begin processing the first byte (e.g. if the first bit of the first byte in the buffer was not at the LSB position, but somewhere in the middle, ex: bit 3: xxxx1xxx). If I haven't been clear enough in my description, please say so. Thanks, Scott -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist