请问C ++ code编译成汇编codeS? [英] Does the C++ code compile to assembly codes?

查看:187
本文介绍了请问C ++ code编译成汇编codeS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请问C ++ code编译成汇编code?如果我们有C ++ code,我们将能够获得组装code?

Does C++ code compile to assembly code? If we have C++ code, will we be able to get assembly code?

推荐答案

绝大多数C ++编译器将其转换C ++源到目标文件(机code有足够的控制信息被链接到可执行文件)。例如,你要真正走出自己的方式来获得 GCC 使用 -s来生成汇编code(ASM源) 标记。通常情况下,你将不会看到组装。

The vast majority of C++ compilers will convert the C++ source into object files (machine code with enough control information to be linked into an executable). For example, you have to actually go out of your way to get gcc to generate assembly code (asm source) by using the -s flag. Normally, you would never see the assembly.

但C ++标准没有强制要求最终形式是由编译器的输出,只是在code具有一定的方式行动,当你运行它。

But the C++ standard doesn't mandate the final form that's output from the compiler, just that the code has to behave in a certain way when you run it.

事实上,最早的C ++编译器实际产生的C源$ C ​​$ C,然后编译的。

In fact, the earliest C++ "compilers" actually generated C source code and then compiled that.

您可以有你的C ++编译器生成目标code,Java字节code,甚至GWBASIC,你应该会感到自虐。

You can have your C++ compiler generate object code, Java byte code, or even GWBASIC, should you be feeling masochistic.

这篇关于请问C ++ code编译成汇编codeS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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