Hi Scott. > > movlw 0xAA ;high? > > subwf TimerH,W > > skpc > > goto EndTime ;5 cycles > > > > movlw 0x55 ;low? > > subwf TimerL,W > > skpc > > goto EndTime ;5 or 9 clocks to go Here is mistake either... What about second example ? (with bug fixed by Bob) Seems it is correct for 0x00 as well. movlw 0xAA ;high? subwf TimerH,W movlw 0x55 ;low? skpnz ;here it was subwf TimerL,W skpc goto EndTime ;8 clocks to go ;7 clocks to pass WBR Dmitry. > Well, I obviously can't improve on Dmitry... But if I'm not mistaken, Tony is > writing some kind of Basic compiler thingy. In which case, the "0xaa55" constant > may be arbitrary (at compile time). So if the lower byte of the constant is > "0x00" then Dmitry's code would have to be modified. It's just a special case... > > But it turns out that there are several special cases each with their optimum > solutions. If you want to see how SDCC handles each then look at "gen.c" in the > PIC SDCC CVS repository: -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics