For what it is worth, I would have designed the whole .cinit thing very differently.... First, the data would be a byte stream starting at location _cinit. Each 'chunk' would be stored as follows: 1 byte - length of chunk 2 bytes - address in RAM to store into N bytes - data to be stored in RAM The code to do the copying would be (WARNING: Untested code ahead): ; Assumptions made: ; ; On entry to this routine PCLATH is correct for this code. ; This code fits entirely within one 2K page of program memory. ; CopyIdataToRam: ; get the initial pointer movlw high(_cinit) movwf pHigh movlw low(_cinit) movwf pLow outer_loop: ; get the count, get out if zero call get_byte skpnz return movwf counter ; get the ram address call get_byte iorlw 0 movwf FSR call get_byte iorlw 0 bcf STATUS,IRP skpz bsf STATUS,IRP ; process all the data bytes inner_loop: call get_byte movwf INDF incf FSR,F ; note: we assume this doesn't carry decfsz counter,F goto inner_loop goto outer_loop ; Local subroutine 'get_byte' ; Advance the pointer and gets a data byte ; Sets Z if the data byte is zero ; Exits with PCLATH correct for this code get_byte: call get_byte_2 ; fetch the byte movwf temp ; save byte we got incf pHigh,F ; advance the pointer incfsz pLow,F decf pHigh,F movlw high(get_byte) ; restore PCLATH movwf PCLATH movf temp,W ; get byte to return, set Z flag return get_byte_2: movf pHigh,W movwf PCLATH movf pLow,W movwf PCL _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist