David Duffy (AVD) wrote: So apparently you're using a PIC 16, or is this just badly written PIC 18 code? > movlw .1 ; Don't do that. The ".1" if very misleading. Yes I know it's legal, but that doesn't make it a good idea. Besides, 1 is the same in any number base. > subwf f1_tmr0,f ;decrement the low byte > skpc ;did it borrow? (0->255) > subwf f1_tmr1,f ;yes, decrement the middle byte > skpc ;did it borrow? (0->255) > subwf f1_tmr2,f ;yes, decrement the high byte > movf f1_tmr0,w ;get low byte again > iorwf f1_tmr1,w ;ior the middle byte in > iorwf f1_tmr2,w ;ior the high byte in > skpz ;is it zero (all bytes zero) > goto cnt_2 ;no, tick not due yet SKPC is also misleading here. In this case the carry flag is the not-borro= w flag. The comment is right, but the choice of macro name could cause confusion. For example, I have macros SKIP_CARR, SKIP_NCARR, SKIP_BORR, an= d SKIP_NBORR for these purposes although they emit only two different instructions. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .