0

我有一个 1995 年编写的旧程序。它是用 Borland C 和 DOS 6.22 编写的。它使用具有不同细分数据的远模型。该程序使用 EMS 内存,这就是为什么指针需要很远。我需要使用 memcmp(a, b, c) 但我收到错误“警告 panel.c 325:函数 enterPanel 中的可疑指针转换”,我怀疑这是因为我有一个远指针。我应该使用远版本的 memcpy 吗?(我搜索过这样的功能,但找不到)。您可能想知道为什么我不只是编写循环代码,而是想使用内在功能来获得最快的速度。

这是我的代码的一个片段:

ASM function
------------
                align   4               
                public  _mainMem
_mainMem        label   dword
mainMem         dd      ?               ;pointer to main memory (if no EMS)

        mov     ax,emsSegment           ;segment of EMS page frame
        mov     word ptr mainMem+2,ax
        mov     word ptr mainMem,0

C program
---------
extern unsigned short _far *mainMem;
short           watchArray[80];
unsigned int    watchAddress, watchLen;

memcmp((_far*)&mainMem[watchAddress], watchArray, watchLen)

我也尝试删除(_far *)。

4

0 回答 0