[comp.arch] Self-modifying CP/M code

jba@harald.ruc.dk (Jan B. Andersen) (10/16/89)

cassel@sce.carleton.ca (Ron Casselman) writes:

>The program would copy itself to a different
>part of memory and change all address references as it did so. It would
>then load a second program into the original location. (all programs
>under CP/M started at a fixed location). The second program would then
>begin to run. Sorry I cannot remember any more details as to the purpose
>of this self-modifying code.

Sounds like the CP/M debugger to me (name ??). I believe that self-modifying
code is quite common in small single-processes OS's, but except for very
special cases (like I/O drivers which someone has mentioned) I think it
should be avoided at all cost.