FP_OFF, FP_SEG
raw OCR
Gets a far address offset or segment.
Defined in header <dos.h>
Syntax
#include <dos.h>
unsigned FP_OFF(void far *p);
unsigned FP_SEG(void far *p);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
The FP_OFF macro can be used to get or set the offset of the far pointer *p.
FP_SEG is a macro that gets or sets the segment value of the far pointer *p.
Return value
FP_OFF returns an unsigned integer value representing an offset value.
FP_SEG returns an unsigned integer representing a segment value.
See also
Example
#include <dos.h>
#include <stdio.h>
#include <graphics.h>
/* FP_OFF V
int fp_off(void)
char *str = "fpoff.c";
printfC'The offset of this file name in memory\
is: %Fp\n", FP_OFF(str));
return 0;
/* FP_SEG */
int fp_seg(void)
{
char *filename = "fpseg.c";
printfC'The segment of this file in memory\
is: %Fp\n", FP_SEG(filename));
return(0);
/* MK_FP V
int main(void)
mt gd, gm, i;
unsigned int far *screen;
detectgraph(&gd, &gm);
if (gd == HERCMONO)
screen = (unsigned int *) MK_FP(OxBOOO,
else
screen = (unsigned int *) MK_FP(
for (i=0; i<26; i++)
screen[i] = 0x0700 + ('a' + i);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/dos.h/FP_OFF/
· short form /3.1/FP_OFF/