什么是FAR PASCAL? [英] what is FAR PASCAL?
问题描述
我想知道为什么在一些源$ C $ C有这些宏象FAR和PASCAL。他们是什么意思,做?
谢谢
I was wondering why in some source code there are these macros like FAR and PASCAL. What do they mean and do? Thanks
推荐答案
-
PASCAL:这涉及到一个调用约定。这些参数压入堆栈左到右的顺序(CDECL对面),和被叫负责返回之前平衡堆栈。
PASCAL: It's related to a calling convention. The parameters are pushed on the stack in left-to-right order (opposite of cdecl), and the callee is responsible for balancing the stack before return.
这调用约定在以下16位API是共同的:OS / 2的1.x和Microsoft Windows 3.x的这里也有一些争议是否被使用Borland的Delphi的1.x
This calling convention was common in the following 16 bit APIs: OS/2 1.x and Microsoft Windows 3.x. There's some dispute over whether it was used by Borland Delphi 1.x
FAR:在分段架构的计算机,一个远指针是一个指针,其中包括段选择,使得可以指向地址当前段的外
FAR: In a segmented architecture computer, a far pointer is a pointer which includes a segment selector, making it possible to point to addresses outside of the current segment.
有关完整性,FAR和PASCAL是pre preocessor宏,编为16位系统时,扩大到有需要声明调用约定和指针大小的关键字。在32位系统上,它们通常扩大到什么(除非你有一个奇怪的默认调用约定)。宏是保留向后兼容{帽子/提示:从阿德里安·麦卡锡评论}
For completeness, FAR and PASCAL are prepreocessor macros that, when compiled for 16-bit systems, expand to the keywords that were necessary to declare the calling convention and pointer size. On 32-bit systems, they generally expand to nothing (unless you have a weird default calling convention). The macros are retained for backward compatibility {hat/tip: comment from Adrian McCarthy}
这篇关于什么是FAR PASCAL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!