FP_OFF()                 Get or Set Offset Portion of a Far Pointer (Macro)
 
 #include   <dos.h>
 
 unsigned   FP_OFF(longptr);
 char far   *longptr;                    Long pointer to memory address
 
    FP_OFF() is a macro that can be used to get or set the offset portion
    of the far pointer 'longptr'.
 
    Returns:    An unsigned integer value representing an offset.
 
      Notes:    FP_OFF() is a macro.
 
  -------------------------------- Example ---------------------------------
 
    The following example gets the offset portion of a far pointer and
    increments it by one.
 
          #include <dos.h>
 
          char far *ptr;
          unsigned int off_val;
 
          main()
          {
               off_val = FP_OFF(ptr);
               FP_OFF(ptr) = ++off_val
               if off_val == 0
                   perror("Segment Wrap caused by incrementing offset")
          }

Seealso:



This page last updated on Fri Nov 30 10:48:32 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster