build a far pointer value from a segment and an offset
#include <i86.h>
void __far *MK_FP( unsigned int segment,
unsigned int offset );
The MK_FP() macro can be used to obtain the far pointer value given by the segment segment value and the offset offset value. These values may be obtained by using the FP_SEG() and FP_OFF() macros.
A far pointer.
#include <i86.h>
#include <stdio.h>
void main()
{
unsigned short __far *bios_prtr_port_1;
bios_prtr_port_1 =
(unsigned short __far *) MK_FP( 0x40, 0x8 );
printf( "Port address is %x\n", *bios_prtr_port_1 );
}
Intel
| Safety: | |
|---|---|
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |
MK_FP() is a macro.