The original poster was looking for a fast way to divide by 14 so he could locate the appropriate byte. The best scenario for the original poster was to do a multiply by 8 (shift by 3), do a divide by 14, do a modulus, and then for the retrieval, do two bitwise shifts (total length of shift depending on exact position), and two ands, and two ors. I probably missed something... My initial glance at your code looks like it still requires the divide by 14, and the multiply by 8, just in opposite directions. (Divide by 14 to get which "block", then multiply by 8 to get the starting address of the block). The retrieval seems worse, though since it requries 8 bitwise shifts, 8 ands, and 8 ors. My solution requires the following: When storing 7 words: For the first 4 words: One compare, and one bitwise and. For the next 2 words: Two compares, two multibit shifts, two bitwise ands, and one or. For the final word: Three compares, four multibit shifts, four bitwise ands, and three ors. -forrest Timothy J. Weber wrote: > I haven't really been paying attention... maybe it would be simpler > like this? > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 (Word 0) > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 > 0 1 2 3 4 5 6 7 8 9 10 11 12 13 (Word 7) > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 (Word 8) > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 > 14 15 16 17 18 19 20 21 22 23 24 25 26 27 (Word 13) > > Then it's just computing the start address and bit, eight consecutive > reads and shift-in. Not sure if it's better or worse for you... > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist