I just tried Michael Rigby-Jones' code and confirmed his results - 10 instructions. (V7.85 with a code generator only a couple of weeks old). I know I have seen the four instruction sequence in the past, but the test code certainly doesn't generate it. Regards, Jim Ham At 08:55 PM 3/22/2000 +1000, you wrote: >On Wed, Mar 22, 2000 at 09:51:16AM -0000, Michael Rigby-Jones wrote: >> It certainly would make a neat macro if it worked. However, I've just tried >> it on V7.85, compiling for a 16F877 with maximum optimisation and it got >> it's knickers in a twist: > >You didn't show your C code, but here's what I tried: > >;x.c: 7: count = (CCPR1H << 8) + CCPR1L; > movf 22,w ;volatile > movwf _count+1 > movf 21,w ;volatile > movwf _count > >Looks fine to me. > > Jim Ham, Porcine Associates (650)326-2669 fax(650)326-1071 "http://www.porcine.com"