Hello,
As Lundin has already indicated, the code being downloaded to the target will need to have been previously compiled and linked so that a binary image of the assembly/machine code is what is sent. Or alternatively, perhaps use S19 format for an ASCII format file, which is easily converted to a binary image, and provides rudimentary error detection.
The linking process will need to be controlled so that the execution location for the code is from the specific block of RAM memory, so that absolute jumps are to the correct address. Relative jumps within the new code are not a problem.
Regards,
Mac