问题
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 asint 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