Tjaart van der Walt wrote: > I feel that one should suffer a little bit in the beginning to > develop a way of thinking. Copying other's code teaches nothing. Tjaart: I understand your point, but I'm not sure that you can make such a blanket declaration about copying others' code. For instance, how long do you suppose it would take a beginner to come up with the following extremely-useful code fragments without ever having seen them used in someone else's code? #1: MOVF SWITCH,W XORLW CASE1 ;IF SWITCH = CASE1, JUMP TO LABEL1. BZ LABEL1 ; XORLW CASE2^CASE1 ;IF SWITCH = CASE2, JUMP TO LABEL2. BZ LABEL2 ; XORLW CASE3^CASE2 ;IF SWITCH = CASE3, JUMP TO LABEL3. BZ LABEL3 ; #2: ADDLW 256-HIVAL ;THIS IS ERIC SMITH'S CODE TO TEST FOR ADDLW (HIVAL-LOVAL)+1 ;"LOVAL <= W <= HIVAL". BC INRANGE ; #3: ADDWF PCL ;CALCULATE 2^W, WHERE W IS IN THE ADDLW 0 ;RANGE [0-7]. ADDLW -1 ; ADDLW -3 ; ADDLW -7 ; ADDLW -15 ; ADDLW -31 ; ADDLW -63 ; ADDLW 121 ; #4: MOVF BLO,W ;DO A 16-BIT SUBTRACTION (A = A - B), SUBWF ALO ;WITH THE CARRY FLAG PROPERLY SET ON MOVF BHI,W ;COMPLETION. SKPC ; INCFSZ BHI,W ; SUBWF AHI ; -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === === Custodian of the PICLIST Fund -- For more info, see: === http://www.geocities.com/SiliconValley/2499/fund.html