Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper/ExoSpace 1.0g - <b>no writing to code</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 No Writing to Code
------------------------------------------------------------------------------

     The protected-mode separation of code and data also prevents you from
     writing to code segments.  An attempt to write to a code segment will
     result in a protection fault.

     In real mode, writing to code often results in a abnormal termination,
     perhaps long after the actual write occurred.  In protected mode,
     overwriting code immediately generates a protection fault.

     Assembly-language programs sometimes intentionally write to code.  Such
     self-modifying code does not work in protected mode.

     Some compiler library functions construct an interrupt instruction
     further on in the function and then execute it.  Other programs store
     data in the code segment as a coding optimization in order to save a few
     CPU cycles.  Interrupt handlers, such as those in commercial libraries
     that support interrupt-driven communications, sometimes store data in
     code segments to save CPU cycles in the handler.  These functions can be
     modified so that they will work equally well in either real mode or
     protected mode.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson