Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>mk_fp() make a far pointer (macro)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 MK_FP()                 Make a Far Pointer (Macro)

 #include   <dos.h>

 void       far *MK_FP(seg,off);
 unsigned   seg;                         Segment
 unsigned   off;                         Offset

    MK_FP() is a macro that makes a far pointer from its component
    segment ('seg') and offset ('off') parts.

       Returns:     A far pointer.

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

    The following statements implement the 'getdta()' function using
    MK_FP(). NOTE: No 'main()' in this example.

           #include <dos.h>     /* for MK_FP, intr and struct REGPACK */

           char far *getdta()
           {
               struct REGPACK regs;

               regs.r_ax = 0x2F;   /* get_dta DOS function # */
               intr(0x21,&regs);   /* call DOS */
               return(MK_FP(regs.r_es,regs.r_bx));  /* return far pointer */
           }

See Also: segread()

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