
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>fp_off</b>
[<<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>
#include <stdlib.h>
int 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 ");
printf("is at %04x:%04x \n", segment,offset);
return EXIT_SUCCESS;
}
Return Value
FP_SEG returns the 16-bit segment value of the far pointer. FP_OFF
returns the 32-bit offset of the far pointer.
See Also
MK_FP
See Also: MK_FP
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson