Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Blinker 5.10 Online Reference - <b> special considerations for protected mode code</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Special considerations for protected mode code
------------------------------------------------------------------------------
 Incompatibilities with protected mode usually arise from certain
 restrictions which were designed into the processor to provide better
 protection and isolation between multiple programs running on the same
 processor. High level language compilers can often detect code which will
 break these restrictions, while other disallowed constructs will only become
 apparent when the code is actually executed at run time. Restrictions on
 coding techniques include :

 . Attempts to access addresses outside (i.e. past the end of) valid
   segments will cause a protection exception.

 . Attempts to directly modify code during execution, or to directly
   execute data, will cause a protection exception.

 . Using segment registers for any other purpose than as segment
   registers. Some code uses the segment registers as a temporary store
   rather than writing it to memory. Whenever the value of a segment register
   is modified the value must be a valid selector or a protection exception
   will occur.

 . Performing real mode address arithmetic e.g. pointer normalisation,
   since segments are no longer contiguous or even adjacent. This usually
   occurs when managing data items larger than 64 Kb, and must be
   re-programmed.

 . All pointers to data buffers which will be passed to real mode code,
   such as when issuing a software interrupt or communicating with a TSR,
   must be valid real mode addresses, so the buffers must have been allocated
   from real memory below 1 Mb. The only exceptions to this are certain DOS
   and BIOS function calls which are handled transparently by the extender.
   A full list of these appears in the section entitled `Transparent software
   interrupt support' later in this chapter.

 It should be emphasised again that occurrences of these coding constructs
 are definitely the exception rather than the rule, and that the higher level
 the language, the less likely one of these constructs is to occur.
 The DOS extender fully supports calls to all the language run time library
 functions, including the EXEC functions which allow running one program from
 inside another, with the exception of the `chain' type function which
 overwrites the calling program with the new program.

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