Self-modifying code: Difference between revisions

Content deleted Content added
added content
Tags: Reverted Mobile edit Mobile web edit
Undid revision 1115990527 by 2001:D08:1814:BAB3:4080:8D27:BBE:61FB (talk) - rvv
Line 4:
{{Use list-defined references|date=December 2021}}
{{Use American English|date=January 2019}}
In [[computer science]], '''pseudoself-enginemodifying generatorcode''' ('''PEGSMC''') is [[Source code|code]] that alters its own [[instruction (computer science)|instructions]] while it is [[execution (computers)|executing]] – usually to reduce the [[instruction path length]] and improve [[Computer performance|performance]] or simply to reduce otherwise repetitively similar code, thus simplifying maintenance. The term is usually only applied to code where the self-modification is intentional, not in situations where code accidentally modifies itself due to an error such as a [[buffer overflow]].
 
Self-modifying code can involve overwriting existing instructions or generating new code at run time and transferring control to that code.
Line 19:
 
In the [[IBM System/360 architecture]], and its successors up to [[z/Architecture]], an EXECUTE (EX) instruction ''logically'' overlays the second byte of its target instruction with the low-order 8 bits of [[general purpose register|register]] 1. This provides the effect of self-modification although the actual instruction in storage is not altered.
 
PEG (.n) - fix, secure or a mark (.exp) a short pin (.obj) bolt or (.adj) tapered at one end.
 
==Application in low and high level languages==