My thanks to those who responded to my question. I have coded the string copy now - not yet tested, but hey it should work! For those interested it is below. For my particular application, I am copying data that is comma delimited. There will be times when I may want to copy more than one field and leave the comma in place between the fields (an example would be a compass heading (xxx.x) followed in the next field by a T or an M to indicate True heading or Magnetic heading. So this part of the string would look like .......,245.2,T, ...... with the ..... indicating there may be data before or after the heading (245.2 degrees True). Assumptions made are: 1. data is comma delimited 2. data to be read is in bank 0 3. data to be written can be in bank 0, 1, 2 or 3 4. the read data pointer is left pointing after the final comma 5. the write data pointer is left pointing to the next free location 6. the read address is loaded into FSR_READ prior to entering the function 7. the write address is loaded into FSR_WRITE prior to entering the function other wise it is a fairly generic function. I would welcome any code reduction tricks. BANK_NUM equ 7bh ;bank number for data STR_TMP equ 7ch ;temp storage for string copy FSR_READ equ 7dh ;temp storage for FSR string copying - read location FSR_WRITE equ 7eh ;temp storage for FSR string copying - write location COMMA_CTR equ 7fh ;counter for commas ;all data received from sentence, so now write to display storage movlw CTE ;point to where to write data movwf FSR_WRITE ;and store movlw 1 ;number of commas to write movwf COMMA_CTR ;and store movlw BUFFER_IN ;point to where temp data is stored movwf FSR_READ ;set up for indirect addressing movlw 1 ;set value to bank 1 movwf BANK_NUM ;and store call STR_CPY ;and call routine to move data STR_CPY ;this routine copies a string from RAM in bank 0 in memory to another bank. ;it uses indirect addressing for both reading and writing, and uses ;commas as delimiters of the data - while the copy will write commas ;in the string, it will not write the terminating comma. movf FSR_READ ;get the read location movwf FSR ;and setup indirect addressing bcf RP0 ;point to bank 0 bcf RP1 ; movf INDF, W ;get the data movwf STR_TMP ;and store incf FSR,1 ;point to next data location movf FSR,W ;get FSR read location movwf FSR_READ ;and store movf STR_TMP, W ;get data xorlw ',' ;was it a comma? btfss Z ;if so skip next goto :loop_1 ;else jump decfsz COMMA_CTR ;subtract one from the comma counter goto :loop_1 ;was not 0 so jump return ;else return :loop_1 ;data was not a comma, or was not the last comma ;determine bank number to write data movf BANK_NUM, W ;get the bank number btfsc Z ;was it bank 0? skip next if not goto :loop_2 ;if so then jump sublw 1 ;else subtract 1 from W btfsc Z ;was it bank 1? skip next if not goto :loop_bank_1 ;if so then jump sublw 1 ;else subtract 1 from W btfsc Z ;was it bank 1? skip next if not goto :loop_bank_2 ;if so then jump :loop_bank_3 bsf RP0 ;point to bank 3 bsf RP1 ; goto :loop_2 ;and jump :loop_bank_2 bsf RP1 ;point to bank 2 goto :loop_2 ;and jump :loop_bank_1 bsf RP0 ;point to bank 1 :loop_2 movf FSR_WRITE,W ;get the write address movwf FSR ;and setup indirect movf STR_TMP,W ;get the data movwf INDF ;and write incf FSR,1 ;increment FSR write address movf FSR,W ;store the FSR write address movwf FSR_WRITE ;in temp storage goto STR_CPY ;and jump back for more David V. Fansler DFansler@MindSpring.com www.DV-Fansler.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body