On 12 July 2013 05:06, electronic.consultation.au@gmail.com < electronic.consultation.au@gmail.com> wrote: > I see, and then how can I reduce them ? > > could it be like this ? > > *movlw LOW .300 > movwf LedTimer > movlw HIGH .300 > movwf LedTimer+1 > > counter* * > Global counter ;Decrementing Sec's > BANKSEL LedTimer ;timer value > * movf LedTimer,w ;for every counts > btfss STATUS,Z ***you do not need this* > decf LedTimer,f > > movf LedTimer+1,w ;for every counts > btfss STATUS,*C <-- carry, not zero* > decf LedTimer+1,f > return* > > Thank you > On 12/07/2013 7:36 PM, IVP wrote: > > Tag added > > > >> how can I enter .300 into LedTimer ? > > You might assign two registers, LedTimer_lo and LedTimer_hi > > > > The low( ) and high( ) operators do the division/remainder for you > > > > movlw low(.300) ;loads LedTimer_lo with 44 > > movwf LedTimer_lo > > > > movlw high(.300) ;loads LedTimer_hi with 1 > > movwf LedTimer_hi > > > > For 24-bit numbers this can be extended to > > > > movlw upper(.300) > > movwf LedTime_up ;if LedTimer_up is also present > > > > If the 300 is defined as a constant, this makes it easier to change > > in the following line rather than in the code > > > > LedTimer =3D .300 > > > > movlw low(LedTimer) > > movwf LedTimer_lo > > > > movlw high(LedTimer) > > movwf LedTimer_hi > > > > A register LedTimer can also be addressed as LedTimer+0, the next > > in memory as LedTimer+1 and so on, if that suits you better > > > > Joe > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .