相关疑难解决方法(0)

Why does Windows64 use a different calling convention from all other OSes on x86-64?

AMD has an ABI specification that describes the calling convention to use on x86-64. All OSes follow it, except for Windows which has it's own x86-64 calling convention. Why?

Does anyone know the technical, historical, or political reasons for this difference, or is it purely a matter of NIHsyndrome?

I understand that different OSes may have different needs for higher level things, but that doesn't explain why for example the register parameter passing order on Windows is rcx - rdx …

windows x86-64 calling-convention

97
推荐指数
4
解决办法
2万
查看次数

x64调用约定(堆栈)和varargs

我已经阅读了微软的文档,但是这个方案太尴尬了,我想我会仔细检查以确保我正确理解它...

我的理解是通过参数传递的通用方法是这样的:

--- bottom of stack ---
(return address)
[shadow space for arg 1]
[shadow space for arg 2]
[shadow space for arg 3]
[shadow space for arg 4]
arg N
arg N - 1
arg N - 2
...
arg 6
arg 5
---- top of stack -----
Run Code Online (Sandbox Code Playgroud)

实施时似乎很尴尬va_arg......这实际上是否正确?

windows 64-bit win64 calling-convention

5
推荐指数
1
解决办法
1755
查看次数

标签 统计

calling-convention ×2

windows ×2

64-bit ×1

win64 ×1

x86-64 ×1