Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Dos Protected Mode Interface - <b>set segment limit</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
        Set Segment Limit


                 This function sets the limit for the specified segment.

            To Call

                 AX = 0008h
                 BX = Selector
                 CX:DX = 32-bit segment limit

            Returns

                 If function was successful:
                 Carry flag is clear.

                 If function was not successful:
                 Carry flag is set.


            Programmer's Notes

                 o    This function  will fail if the selector specified
                      in BX  is invalid or the specified limit could not
                      be set.   16-bit  DPMI implementations can not set
                      segment limits  greater than  0FFFFh (64K)  so  CX
                      must be  zero when  calling  this  function  under
                      these implementations of DPMI.
                 o    Segment limits  greater than  1 meg  must be  page
                      aligned.     That  is,  limits  greater  than  one
                      megabyte must have the low 12 bits set.
                 o    Your program  should only  modify descriptors that
                      were   allocated    through   the   Allocate   LDT
                      Descriptors function.
                 o    To get  the limit  of a segment you should use the
                      instruction lsl  (load  segment  limit)  which  is
                      supported on  80286 and 80386 machines.  Note that
                      on 80386  machines you will need to use the 32-bit
                      form of  lsl   if the  segment has a limit greater
                      than 64K.

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