Ascii chars are only 7 bits if doing a table read on a chr $ then set = bit 7 to 1 for the terminate char and test for that (unless you are doing jap chrs)that will save a byte per string assy below extract from lcd driver that cant send funny chars bits in >> >> does the check for end of = string Steve... MOVWF STRNUM ; SAVE STRING NUMBER MOVLW 0FFH ; POINTER TO BEGINING OF STRING MOVWF TABOFF ; WELL IT IS NOW DOSTR PAGE1 ; SET PAGE MARKER CALL CALLSTR ; GET STRING CHAR POINTED TO IN TABOFF PAGE0 ; RESET PAGE MARKER >> MOVWF LCDCH ; SAVE CHAR ANDLW B'01111111' ; MASK END BIT (END OF STRING MARKER) CALL LCD_OUT ; SEND CHAR BTFSS LCDCH,7 ; CHECK LAST GOTO DOSTR ; NOT FINISHED DO SOME MORE >> RETLW 0 ; EXIT -----Original Message----- From: pic microcontroller discussion list = [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Spehro Pefhany Sent: 22 July 2003 21:13 To: PICLIST@MITVMA.MIT.EDU Subject: Re: Out of ROM PIC18F452 ....what do to? At 08:07 PM 7/22/2003 +0100, you wrote: >Are C compilers intelligent enough to convert Print "HELLO ALL" to a=20 >data table and then read that data back from the table or do they=20 >convert it to:- Strings in standard C are stored as a null-terminated array of char, so = your "HELLO ALL" would take (at least) 10 bytes (9 for the characters plus 1 = for the terminating null). It might take more, especially on a >8 bit = processor. The parameter to the print routine would be a pointer to const char, in other words, the address in program memory where the string begins. The print routine (eg. cputs ) would just grab a character, terminate if it's a null, otherwise print it, increment the local copy of the = pointer, and repeat. So a const string declaration would look like this: const char hello[]=3D "HELLO ALL"; , which would use 10 bytes of FLASH. = It may or may not be padded up to the next even byte. ..the print statement would be something like cputs(hello); The call would be the same number of bytes regardless of the length of = the string. You could, and probably would, write it just about the same way in = assembly, of course. This is the kind of stuff that C does very well. Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: = http://www.trexon.com Embedded software/hardware/analog Info for designers: = http://www.speff.com -- http://www.piclist.com hint: The list server can filter out subtopics = (like ads or off topics) for you. See http://www.piclist.com/#topics -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics