c语言中的远函数指针是什么,它的语法是什么
what is far function pointer in c language and what is syntax of it?
在下面给出的c语言中,远函数指针的语法是什么,下面语句中"远"的用法是什么?为什么在他的陈述中使用了far?
int (far *directCall_setBank)(void);
int VBE_getModeInfo(short mode) {
VBE_ModeInfoBlock modeInfo; //Temporary holding space for returned VBE info
REGS r; //Register structures for passing to 'int86x()'
SREGS s; //(SREGS includes the segment registers)
r.x.ax=0x4F01; //AL = 0x01, "get VBE Mode Info"
r.x.cx=mode; //CX = mode to get info for
r.x.di=FP_OFF(&modeInfo); //address ES:DI to our ModeInfoBlock structure
s.es=FP_SEG(&modeInfo); //so that the VBE driver will fill its values
int86x(0x10,&r,&r,&s); //call interrupt 0x10 (through a C function call)
screen_width=modeInfo.resX; //Store the values returned in
screen_height=modeInfo.resY; //'modeInfo'
directCall_setBank=modeInfo.winFuncPtr; //INCLUDING the pointer to our function
return((int)r.h.ah); //Return the VBE status in AH
}
它在dos时代使用,并且非常特定于机器(内存模型)。为了使C独立于特定的体系结构,C在标准语言中从未接受far关键字,但它可以作为某些编译器的扩展。
相关文章:
- C++避免重复声明的语法是什么
- 这个语法std::class<>{}(arg1, arg2) 在C++中是什么意思?
- 使用基类指针调用基类的值构造函数的语法是什么?
- 将信息输入到下面显示的结构向量中的正确语法/格式是什么
- 这是什么类型的C++语法,我应该采取什么步骤来理解这一点
- 这行/语法是什么意思?
- 初始化对象以在 C++08 中作为参数传递的首选语法是什么?
- 将引用绑定到指针的语法是什么?(各种)
- 这个typedef和转换运算符语法是什么意思
- C++中抽象语法树最常用的表示法是什么
- 此语法是什么意思.(::*).
- 将显式指定的函数模板重载作为模板参数传递的正确语法是什么?
- 语法问题:"char [5] const &"是什么意思?
- 使用 pybind11 绑定 typedef 类型的正确语法是什么?
- 将此类传递给引用的正确语法是什么?
- 带有约束的可变参数模板的'requires'表达式的语法是什么?
- 这是什么语法: std::thread t([&] () { ... });?
- 这是什么语法?int我{10}
- 这是什么语法- new (this) T();
- 这是什么语法: "ACGT" [(int)qrand() % 4]