MK_FP是一个宏。功能是做段基址加上
偏移地址的运算,也就是取
实际地址。
简介
函数名: MK_FP
函数原型: #define MK_FP( seg,ofs )( (void _seg * )( seg ) +( void near * )( ofs ))
用 法: void far *MK_FP(unsigned seg, unsigned off);
程序例
#include
#include
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;