Self-modifying code: Difference between revisions

Content deleted Content added
No edit summary
mNo edit summary
Line 98:
 
What this code does is basically that it changes the execution flow, and determines by [[brute force]] how large the PIQ is. "How far away does I have to change the code in front of me for it to affect me?"
If it is too near (it is already in the PIQ) the update will not have any affect. If it is far enugh, the change of the code will affect the program and the program has then found the size of the processors PIQ.
If this code is being executed in protected mode, the operating system must not make any [[context switch]], or else this program may return the wrong value.
 
==Example algorithm (theoretical!)==