Well it turns out the more intuitive way is also a little faster. That is if I
have done this correctly.
I used [view] [program memory] in MPLab and counted the number of
instructions between the start and end labels.
This code was 18 lines:
This code was 16 lines:Code:StartTest: adcData.lowbyte[Index] = ADRESL adcData.lowbyte[Index+1] = ADRESH EndTest:
So as long as I can afford the extra word variable, I will be using theCode:StartTest: tempWord.highbyte = ADRESH tempWord.lowbyte = ADRESL adcdata[index] = tempword EndTest:
temp variable way...... unless someone else reveals a clever trick.
thanks all for your replies,
Mike -
Bookmarks