每个函数名称后面的@n(“符号")是什么? [英] What is the @n ("at sign") after every function name?

查看:395
本文介绍了每个函数名称后面的@n(“符号")是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Netwide汇编程序学习汇编语言.

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

在教程中,我看到每个函数名称的末尾都有一个@n,例如:

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

@n是什么意思?

What does this @n mean?

(这似乎是函数名称的一部分,因为如果我修改或删除该部分,则会出现error LNK2001: unresolved external symbol错误,但显然,它不是其生成的C或C ++函数名称的一部分.它来自哪里?)

(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?)

推荐答案

这些都是 stdcall名称修饰:

Those are stdcall name decorations:

名称装饰约定
下划线(_)是该名称的前缀.名称后跟at符号(@),后跟参数列表中的字节数(十进制).因此,声明为int func( int a, double b )的函数的修饰如下:_func@12

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

C/C ++编译器会为您自动处理此操作(某些汇编程序也会自动处理),这就是您以前从未见过的原因.

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

这篇关于每个函数名称后面的@n(“符号")是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆