First, please fix your reply address to go to the list instead of just you. > 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 Using EQUs to hard coded values to define variable symbols is a really bad idea. The assembler has no way of catching it if you accidentally define multiple variables at the same address. > ;all data received from sentence, so now write to display > storage > movlw CTE ;point to where to write data I don't see CTE defined anywhere. > 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 This is dangerous because it hard codes that the destination buffer (apparently CTE) is in indirect bank 1. This should be movlw high(CTE) ;get indirect bank number of dest buf > 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 ; CLRF STATUS would have done that in one instruction. However, this won't work because it sets the direct register bank, not the indirect register bank that FSR and INDF use. > movf INDF, W ;get the data > movwf STR_TMP ;and store > incf FSR,1 ;point to next data location ^ Don't do that. Use the F or W constants defined in the Microchip include file. That's what they are for. > movf FSR,W ;get FSR read location Again, there is no point in reading FSR back. You could just as well have incremented FSR_READ directly. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body