| ??? 09/19/06 13:55 Read: times |
#124557 - Poor example Responding to: ???'s previous message |
Erik Malund said:
we have a "modular by russ" serial module to get, say 1024 bytes from serial we need to do this to load a buffer for (index = 0; index <1024 ; index++)
{
SpecificBuffer[index] = getCharacter();
}if we program 'small embedded' instead of 'PC' we do thisfor (index = 0; index <1024 ; index++)
{
SpecificBuffer[index] = GlobalSerialBuffer[index];
}and have saved something like 20*1024 instruction cycles
That's fine provided it really is just a one-to-one copy from index 1 to index 1, index 2 to index 2, etc. But if getCharacter() does something more useful, like dealing with a circular buffer, there's going to be a lot less in it. |



