基本介紹
簡介,程式例,
簡介
函式名: MK_FP
函式原型: #define MK_FP( seg,ofs )( (void _seg * )( seg ) +( void near * )( ofs ))
函式位置: dos.h
函式說明:功 能: 設定一個遠指針
用 法: void far *MK_FP(unsigned seg, unsigned off);
程式例
#include <dos.h>
#include <graphics.h>
int main(void)
{
int gd, gm, i;
unsigned int far *screen;
detectgraph(&gd, &gm);
if (gd == HERCMONO)
screen = MK_FP(0xB000, 0);
else
screen = MK_FP(0xB800, 0);
for (i=0; i<26; i++)
*screen++ = 0x0700 + ('a' + i);
return 0;
}