A method for updating code includes receiving an update command for a
first program resident in a first code space including at least one
segment, transferring program control to a second program executing in
second code space including one or more segment, selecting one of the at
least one segment, mapping the selected segment to data space and writing
the selected segment. A method for detecting corrupt software code
includes defining a correlation rule for a program that includes at least
one segment that includes multiple markers. The correlation rule defines
a relationship between two or more of the markers. The method also
includes writing the program to a memory device, reading two or more of
the markers from the memory device, determining whether a segment is
corrupt by applying the correlation rule to the two or more markers and
indicating whether the segment is corrupt based upon the determining.