Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - fp_off, fp_seg http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   FP_OFF, FP_SEG

   Usage
   #include <dos.h>
   unsigned FP_OFF(int far *fpointer);
   unsigned FP_SEG(void far *fpointer);

   Description
   FP_OFF and FP_SEG are used to split far pointers into their offset and
   segment parts. These functions are implemented as macros.

   Example
   #include <dos.h>
   #include <stdio.h>
   main()
   {
   char far *p;
   unsigned int segment, offset;
        p = MK_FP(0xb000,0);
        segment = FP_SEG(p);
        offset = FP_OFF(p);
        printf("The mono video segment:offset is at
                       %04x:%04x \n", segment,offset);
   }

   Return Value
   FP_SEG returns the 16-bit segment value of the far pointer.
   FP_OFF returns the 16-bit offset of the far pointer.


See Also: MK_FP

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