What is the @n (“at sign”) after every function name?

时间秒杀一切 提交于 2019-12-24 03:19:35

问题


I'm trying to learn assembly language, using Netwide Assembler.

In tutorials, I see that there's an @n at the end of every function name, like:

CALL _GetStdHandle@4

CALL _WriteFile@20

CALL _ExitProcess@4

What does this @n mean?

(It seems to be part of the function name, in that I get error LNK2001: unresolved external symbol errors if I modify or remove that part, but obviously it's not part of the name of the C or C++ function that it was generated from. Where does it come from?)


回答1:


Those are stdcall name decorations:

Name-decoration convention
An underscore (_) is prefixed to the name. The name is followed by the at sign (@) followed by the number of bytes (in decimal) in the argument list. Therefore, the function declared as int func( int a, double b ) is decorated as follows: _func@12

A C/C++ compiler would handle this automatically for you (and so would some assemblers), which is why you haven't seen this before.



来源:https://stackoverflow.com/questions/28039697/what-is-the-n-at-sign-after-every-function-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!