Steve Baldwin wrote: > For example. All the books make out that beginners can't understand > pointers but if you think of > > char *TEXT > as > TEXT: DB 'My string', 0 > > then TEXT has some meaning. You know that TEXT is the address of the > 'M' and that if you increment it, it will be the address of (point > to) the 'y'. Steve: I'm sure that you understand the concept of pointers, but your example -- not to put too fine a point on it -- sucks. In your C statement, "*text" is a VARIABLE, but in your assembly statement, "TEXT" is a CONSTANT... You CAN"T "increment it", and it DOESN'T "point to the 'y'". A more accurate example, if you really do want to point to a constant array of characters stored in the PIC's program-space, might be: Think of: char *text; text = "My string"; as equivalent to: TEXT EQU [any register] LOOKUP: MOVWF PC STRING: DT 'My string', 0 MOVLW STRING MOVWF TEXT And think of: char x; x = *text; as equivalent to: X EQU [any register] MOVF TEXT,W CALL LOOKUP MOVWF X This example, of course, is subject to a few restrictions having to do with the placement of the "STRING" table in memory... If you wanted to show an example that dealt with character arrays in RAM, it would be: Think of: char *text; char string[] = "My string"; text = string; as equivalent to: TEXT EQU [any register] STRING EQU TEXT+1 MOVLW "M" MOVWF STRING MOVLW "y" MOVLW STRING+1 .... MOVLW "n" MOVWF STRING+7 MOVLW "g" MOVWF STRING+8 MOVLW 0 MOVWF STRING+9 MOVLW STRING MOVWF TEXT And think of: char x; x = *text; as equivalent to: X EQU [any register] MOVF TEXT,W MOVWF FSR MOVF INDF,W MOVWF X -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499