Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>segread() return current values of segment registers</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 segread()               Return Current Values of Segment Registers

 #include   <dos.h>

 void          segread(segregs);
 struct SREGS  *segregs;                 Segment register values

    segread() sets the fields in 'segregs' to the current contents of the
    segment registers.  The segment registers are needed with the
    intdosx() and int86x() functions.

    Returns:    No return value, just sets 'segregs'.

      Notes:    Segment registers for 'far' pointers can be obtained with
                the FP_SEG() macro.

 Portability:   Applies to MS DOS only.

   -------------------------------- Example ---------------------------------

    The following statement prints the current contents of the segment
    registers.

           #include <dos.h>             /* for segread() and struct SREGS */
           #include <stdio.h>           /* for printf() */

           struct SREGS segregs;

           main()
           {
               segread(&segregs);
               printf("CS: %u  DS: %u  ES: %u  SS: %u\n",
                      segregs.cs, segregs.ds, segregs.es, segregs.ss);
           }


See Also: FP_SEG()

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