PIC Microcontroller Math Method

Increment / Decrement

Best 16 bit

From Scott Dattalo

;inc
  decf    high,f
  incfsz  low,f
   incf   high,f


A downcounting version;
;dec
  movf    low,f
  skpnz
   decf   high,f
  decf    low,f


on the 18cxxx you can simplify these to:

  infsnz  low,f
   incf   high,f

and
  tstfsz  low,f
   decf   high,f
  decf    low,f

Interested: