Todd, The usual way to do this is with a lookup table. In the case of a PIC, the data is contained in a list of RETLW instructions. You access the data by CALLing the associated ADDWF PCL,F instruction that prefaces the actual table data. To illustrate, here is a sample from my digital capacitance meter that enters with a code in W and returns with the decoded value in W. ;note that jump tables and decoder tables are limited to 256 bytes of program space, ;and care must be taken that tables not cross over page boundaries. ;the limitation is based on the 8 bit addressing scheme employed in tables due to ;the size of w. ;decoder tables take the form: ;label ; addwf pcl,f ;this executes an effective jump forward ; retlw 'a' ;0 decodes as 'a' ; retlw 'b' ;1 decodes as 'b' ; retlw 'c' ;2 decodes as 'c' ... and so on ; ;EXAMPLE ;convert rightmost nibble into one of 16 8 bit ascii codes convert andlw b'00001111' ;just the right nibble in this example addwf pcl,f ;this executes an effective jump forward 0-15 retlw '0' retlw '1' retlw '2' retlw '3' retlw '4' retlw '5' retlw '6' retlw '7' retlw '8' retlw '9' retlw ' ' ;decode the special stuff, too retlw '+' retlw '-' retlw ',' retlw '.' retlw '_' ;underscore _ used for non-existent digits ;text for lcd messages sometext ;routine to extract string pieces addwf pcl,f ;this executes an effective jump forward starttext begin1text dt "PIC CAP METER",0 ;put *your* name or message here 16 max begin2text dt "Fr Tom McGahee",0 ;put *your* name or message here 16 max autotext dt "AUTORANGING ",0 overtext dt "OVER-RANGE!",0 manual2text dt "MANUAL MODE",0 fourspaces dt " " ufnfpftext dt " ",mu,"f nf pf",0 ;that mu is code for greek letter zerotext dt "ZERO ALL RANGES",0 ;*************************************************************** ;********** ;example showing how to decode value in W call convert ;that's it, folks! ;********** ;example showing how to output a zero terminated string. movlw begin1text-starttext ;get proper offset address into W call textout ;output text until zero. ;********** ;sample routine to output a zero terminated string. textout movwf temp1 ;save the offset address that is in W! textloop call sometext ;retlw a byte addlw 0 ;set z flag if we recovered terminating 0 btfsc status,z return ;once we got 0 we are done call lcdout ;everything else we send to lcd incf temp1,f ;NEXT ADDRESS! movf temp1,w ;need new address in both temp1 and w goto textloop ;do a whole string of 'em **************************************** Todd, in your case you would want to extract one column at a time of row data. The letter "A", for example, might appear on the LEDs in the classic 5x7 font: * * * * * ***** * * * * * * This in turn can be represented in binary format: 00100 a 01010 b 10001 c 11111 d 10001 e 10001 f 10001 g If this is rotated 90 degrees to the right we get: x1111100 ;the 'x' is the so far unused msb x0001010 x0001001 x0001010 x1111100 Let's arbitrarily make the 'x' a 0. 01111100 00001010 00001001 00001010 01111100 The decode table would look like this: alpha_decode alpha_decode_first addlw 0-'0' ;'0' becomes 0, '1' becomes 1, etc movwf alpha_temp ;assume a memory variable for temp storage bsf flags,carry ;clear carry rlf alpha_temp,f ;val*2*2+val = val*5 rlf alpha_temp,f addwf alpha_temp,f ;alpha_temp contains offset address alpha_decode_next movf alpha_temp ;W now also contains offset address addwf pcl,f ;this executes an effective jump forward alpha_0 ;'0' is entry 0 b'00111110' b'01000001' b'01000001' b'01000001' b'00111110' ;..... table continues with 5 byte entries for ; 1 2 3 4 5 6 7 8 9 ; also : ; < = > ? @ ;..... these are not shown in this example alpha_a ;'A' is entry 17 b'01111100' b'00001010' b'00001001' b'00001010' b'01111100' alpha_b ;'B' is entry 18 b'01111111' b'01001001' b'01001001' b'01001001' b'00110110' etcetera...... up to 'Z' Because the table contains 5 bytes per character, the routine 'alpha_decode_first' is called first, and then for each additional byte 'alpha_temp' is incremented and then 'alpha_decode_next' is called. for example: ;assume W contains the ascii value call alpha_decode_first call do_something_with_W ;column 1 incf alpha_temp,f call alpha_decode_next call do_something_with_W ;column 2 incf alpha_temp,f call alpha_decode_next call do_something_with_W ;column 3 incf alpha_temp,f call alpha_decode_next call do_something_with_W ;column 4 incf alpha_temp,f call alpha_decode_next call do_something_with_W ;column 5 I hope this helps. Fr. Tom McGahee >>> tcphelps@YAHOO.COM 07/04/01 08:26AM >>> Hi folks, I'm sure this has come up before, but is there a way to store and read numerical data from the program memory of the 16F84? I've been working on a "Propeller Clock" and while there is enough memory to store numbers in the EEPROM I wouldn't mind being able to store letters for the days of the week if possible (without having some sort of add-on memory chip). If I only use half the program memory is there any way of storing font data in the other half during the programming stage (and then accessing it as my software is running)? I'd rather not have several functions a la "drawM:" "drawT:" "drawS:"... Thanks! Todd. __________________________________________________ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body