Talk:Self-modifying code: Difference between revisions

Content deleted Content added
Reentrant self-modifying code is possible: No existing code is being modified; it's just using a template in the process of generating fresh code.
Disadvantages: new section
 
(3 intermediate revisions by 3 users not shown)
Line 1:
{{WikiProject Computer sciencebanner shell|class=C|
{{WikiProject Computer science |importance=Mid}}
{{WikiProject Computing |software=y |software-importance=Low |class=C |importance=Low}}
}}
 
==TODO==
Line 141 ⟶ 144:
 
Does anyone know if there is a citation for the anecdote of using self-mod code as a copy protection technique on the Apple II? I remember reading about it somewhere 20 years ago when I was 'into' the Apple II in high school (back when "20 megabytes" was considered "really in-humanly humungously big" LOL) [[User:Jimw338|Jimw338]] ([[User talk:Jimw338|talk]]) 21:35, 14 March 2013 (UTC)
 
:Don't know about Apple II, but I hae one PC game that used self-mod as copy protection. One had to käy in sequence from The manual and If it was correct The software rewrote some instructiins so that The program would run. The reason I sound it was because I had copied disk and no manual. Used assembler debugger to check what was going on and found that self modifing codes. Bypassed IT and The game functioned like it should. [[Special:Contributions/217.140.200.97|217.140.200.97]] ([[User talk:217.140.200.97|talk]]) [[Special:Contributions/217.140.200.97|217.140.200.97]] ([[User talk:217.140.200.97|talk]]) 20:06, 9 April 2025 (UTC)
 
== Really bad ==
Line 188 ⟶ 193:
Is Massalin's Synthesis kernel really relevant here? I propose removing it. [[User:Peter Flass|Peter Flass]] ([[User talk:Peter Flass|talk]]) 16:26, 11 January 2019 (UTC)
* '''Keep''' - surely it is an example of self-modifying code, and done by an operating system to itself? As distinct from an operating system modifying its various internal tables or linked-lists to activate or terminate a new task.[[User:NickyMcLean|NickyMcLean]] ([[User talk:NickyMcLean|talk]]) 08:49, 12 January 2019 (UTC)
 
== Reality check from Redmond. ==
 
Article should mention that self-modifying code is essentially incompatible with '''digitally signed executables''' (which is a common practice and gradually becoming a de facto requirement within the Microsoft Windows OS ecosystem). [[Special:Contributions/94.21.160.52|94.21.160.52]] ([[User talk:94.21.160.52|talk]]) 23:06, 5 December 2024 (UTC)
 
== Disadvantages ==
 
This does not seem to belong in the "Disadvantages" section: ''"Self-modifying code can be rewritten as code that tests a flag and branches to alternative sequences based on the outcome of the test, but self-modifying code typically runs faster."'' The statement that it can be rewritten doesn't seem to be a disadvantage, and the statement that it runs faster seems clearly to be an advantage.
 
So, this could possibly be listed in "Advantages" as: ''"Self-modifying code typically runs faster than equivalent code that tests a flag and branches to alternative sequences based on the outcome of a test."'' - but seems a bit redundant with the existing "Fast paths can be established for a program's execution..." statement. Comments? [[User:Harris7|Harris7]] ([[User talk:Harris7|talk]]) 12:00, 21 June 2025 (UTC)