Brendan Moran wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Actually it is. You store the new pins in an XORed > > form. :o) But there is a problem that your code below > > still takes 9 cycles (once goto is included). > > > > ;------------------------- > > ; now output current2 > > movf current2,w ; > > movwf PORTB ; send to motor! > > nop > > movf inputs_last,w > > xorwf PORTA,w > > movwf diff > > skpz > > goto pwm_loop > > > > > > > What is your're trying to do? > > So drop the NOP Whoops! Me stupid! Sorry Scott and Brendan etc, in my rush to criticize I forgot that the PORTA read is NOT the next instruction after the nop. So it seems to be done, with Scott's solution needing no work and only two extra cycles upon exit to give the required "inputs" variable. I can live with that. :o) -Roman -- 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