Self-modifying code: Difference between revisions

Content deleted Content added
No edit summary
wikify -- Wikipedia uses # for numbered lists not <1> <2> ...
Line 5:
The kinds of self-modifying code that used in assembly, can be for various purpuses:
 
<1># Optimisation of a state dependant loop.
<2># runtimeRuntime code generation, or specialisation of an algorithm in runtime or loadtime (which is popular, for examplein the ___domain of real-time graphics).
<3># alterAltering of inlined state of an [[object (programming)|object]], simulating the high level construction of [[Closure (programming)|closures]].
<4># patchingPatching of subrouting address calling, as done usually at load time of [[DLL|dynamic libraries]]. Wherther this is regarded 'self-modifying code' or not is a case or terminology.
 
TypesThe <2>,<3>second and third types are proboably the kinds mostly used also in high-level languages, such as [[LISP]].
<2> runtime code generation, or specialisation of an algorithm in runtime or loadtime (which is popular, for examplein the ___domain of real-time graphics).
 
Pseudo-code example of type <1>:
<3> alter inlined state of an [[object (programming)|object]], simulating the high level construction of [[Closure (programming)|closures]].
 
<4> patching of subrouting address calling, as done usually at load time of [[DLL|dynamic libraries]]. Wherther this is regarded 'self-modifying code' or not is a case or terminology.
 
Types <2>,<3> are proboably the kinds mostly used also in high-level languages, such as [[LISP]].
 
Pseudo-code example of type <1>:
 
repeat N times {