picnoob wrote: > srry to bother u ppl again with wot is probably a trivial question, but im > not sure i quite understand the decfsz function. It's not advisable to use "chat slang", it may get you in trouble here. :) > here is a delay routine i found on the www, that counts to 255, 255 times: > > (count1 and count2 both contain the value 255) > > Delay > Loop1 decfsz COUNT1,1 ;reduces COUNT1 by 1 > goto Loop1 ;if COUNT1 isnt 0, reduce > it again(im understandin so far) > decfsz COUNT2,1 ;reduce COUNT2 by 1 > goto Loop1 ;HUH, WHA?? why are we > going > back to loop1, and how has COUNT1 magically ;been > brought > back to its initial value? > return > > why does the count1 variable not remain 0 once it has been decfsz-ed to 0? > and what does the ",1" do at the end of the decfsz? > > this is quite confusing. If COUNT1 is zero (0x00), and you subtract 1 from it, it becomes 255 (0xFF). Think of the tape recorder counter: which number comes after 000 if you go backwards? Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist