On Feb 16, 2005, at 1:30 PM, Wouter van Ooijen wrote: > But it (plus a few other C 'features') makes possible a programming > construct that is at the same beatiful and ugly: the interleaved > for/switch, which unrolls a for loop while (with the same code) > handling > the left-over iterations. I forgot what it's called though. > I think you're talking about "Duff's device" send(to, from, count) register short *to, *from; register count; { register n=(count+7)/8; switch(count%8){ case 0:do{*to = *from++; case 7:*to = *from++; case 6:*to = *from++; case 5:*to = *from++; case 4:*to = *from++; case 3:*to = *from++; case 2:*to = *from++; case 1:*to = *from++; }while(--n>0); } } -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist