A method and apparatus for reallocating in the local memory of an
implantable medical device for upgrading operating software stored in the
Code portion of the local memory. The local memory is managed so that new
software e.g., a code segment, is accepted into memory provisionally, and
then validated before being used to replace existing (i.e., old)
software. Each new segment is received in its entirety and its integrity
validated before the old software is overwritten. Data log information is
downloaded to an external programmer at the start of a software upgrade
operation to temporarily free memory space without losing any
information. This freed memory space is then reassigned for the purpose
of temporarily storing new code segments until they can be received in
their entirety and validated. A software copying component is transferred
from a local memory code portion to a data portion to allow new code
segments to be written into any area of said code portion.