void hello()
{
printf("hello every one");
}
#define BYTE unsigned char
#define WORD unsigned int
#define DWORD unsigned long
DWORD ptr_hello;
void main()
{
WORD* ptr = (WORD *)ptr_hello;
ptr[1] = FP_SEG(&hello);
ptr[0] = FP_OFF(&hello);
__asm
{
call ptr_hello
}
while(!kbhit());
}
我想做一下实验,结果是编译通过,不能执行,说CPU遇到无效的命令,请教为什么这样不行呢
{
printf("hello every one");
}
#define BYTE unsigned char
#define WORD unsigned int
#define DWORD unsigned long
DWORD ptr_hello;
void main()
{
WORD* ptr = (WORD *)ptr_hello;
ptr[1] = FP_SEG(&hello);
ptr[0] = FP_OFF(&hello);
__asm
{
call ptr_hello
}
while(!kbhit());
}
我想做一下实验,结果是编译通过,不能执行,说CPU遇到无效的命令,请教为什么这样不行呢
