??? 03/06/09 21:30 Modified: 03/06/09 21:32 Read: times |
#163183 - Try without loop counter Responding to: ???'s previous message |
I don't think he want to loop 257 bytes in 60us. He wants the copy to take 60ns/byte, i.e. no slower than 15.42us for 257 bytes :)
Something to think about when you do a loop with pointers is that a lot of processors (or compilers) will like the following better: char buf[257]; char *src = buf; char *end = buf + 257; char *dst = &FIO_PIN[3]; while (src < end) *dst = *src++; The compiler should notice that "end" is a constant and that it can drop the it (or at least reduce number of modified variables) and instead compare your pointer with a constant to decide when to break. Besides helping the code, you may also reduce the number of used registers. |