Ahh, I didnt notice that it was the wrong way round. It is right in my code though because i wrote it out myself instead of copy/paste (i remember better that way).
Heres how my code looks now. I think its all right
Code:; Get the start address for the array MOVLW _bOutData ; Set WREG to the start of the bOutData array ADDWF _bOutDataPos,0 ; Add bOutDataPos to the address and store back in WREG MOVWF FSR0 ; Copy WREG to the indirect file register ; Control character MOVLW _cControlCharOut ; Copy the output control character to WREG MOVWF POSTINC0 ; Copy WREG to bOutData[bOutDataPos] (specified by indirect file register) and increment FSR0 INCF _bOutDataPos ; Increment the array position ; Data length MOVLW 0 ; Set WREG to 0 MOVWF POSTINC0 ; Copy WREG to bOutData[bOutDataPos] INCF _bOutDataPos ; Increment the array position ; Chip address MOVFF _aAddress,POSTINC0 ; Copy aAddress to bOutData[bOutDataPos] INCF _bOutDataPos ; Increment the array position ; Action MOVLW _cActionPing ; Copy the ping action character to WREG MOVWF POSTINC0 ; Copy WREG to bOutData[bOutDataPos] INCF _bOutDataPos ; Increment the array position




Bookmarks