c++ - 什么是远帕斯卡?

标签 c++ c syntax

我想知道为什么在某些源代码中会有 FAR 和 PASCAL 之类的宏。它们的含义和作用是什么?

最佳答案

  • PASCAL:它与 calling convention 有关.参数按从左到右的顺序入栈(与cdecl相反),被调用者负责在返回前平衡栈。

    这种调用约定在以下 16 位 API 中很常见:OS/2 1.x 和 Microsoft Windows 3.x。 Borland Delphi 1.x 是否使用它存在一些争议

  • FAR:在分段架构计算机中,far pointer是一个包含段选择器的指针,可以指向当前段之外的地址。

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}

关于c++ - 什么是远帕斯卡?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2774171/

相关文章:

c++ - Qt QSplitter 和无响应的 GUI(cpu 100%)

c++ - QGridLayout 设置最大列宽

c - 在 C 中读取二维字符数组有困难吗?

C TCP/IP 服务器绑定(bind)错误 -- 非套接字上的套接字操作

c++ - 函数模板特化语法聚合模板化类型

c++ - C++中的简单列表

c - ruby C 扩展 : turning int function into ruby value

c - 了解特定 C 指针定义的学校作业

vb.net - Delphi中数字前面的 "$"是什么意思?

python - 一个非常短的代码,但 python 中的语法无效?