gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 21:39:01 24 4
gpt4 key购买 nike

我想知道为什么在某些源代码中会有 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com