当前位置:网站首页>clang 如何产生汇编文件
clang 如何产生汇编文件
2022-04-23 07:04:00 【zhonguncle】
有时候为了学习或者调试,需要查看程序的汇编代码。这在很多 GUI 的 IDE 中很方便实现,例如在 Xcode 中,点击“Product”-“Perform Action”-“Assemble 文件名”就可以,如下:

那么在终端中呢?
首先写一个 C 源码文件 test.c。内容如下:
#include <stdio.h>
int main() {
printf("hello world!\n");
return 0;
}
然后使用以下命令:
$ cc -S test.c
这时候会产生一个名为test.s的文件,里面就是汇编语言,如下:

希望能帮到有需要的人~
版权声明
本文为[zhonguncle]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_33919450/article/details/124358476
边栏推荐
猜你喜欢

【无标题】

1216_ MISRA_ C standard learning notes_ Rule requirements for control flow

Comparison of indoor positioning methods of several intelligent robots

岛屿的个数

NLLLoss+log_SoftMax=CE_Loss

Feign source code analysis

校园转转二手市场源码下载

巨头押注的全屋智能,正在驱动海信、华为、小米们「自我革命」

谈谈那些基础但不简单的股票数据

Construction of middleman environment mitmproxy
随机推荐
LeetCode简单题之重新排列日志文件
3C裝配中的機械臂運動規劃
編譯原理題-帶答案
常用正则表达式
DataBinding的使用五
【无标题】
Alibaba sentinel learning QA
学fpga(从verilog到hls)
Ubuntu安装Mysql并查询平均成绩
Data security has become a hidden danger. Let's see how vivo can make "user data" armor again
Compiling principle questions - with answers
Thinkphp6 + JWT realizes login verification
利用sqlmap注入获取网址管理员账号密码
Go语学习笔记 - 语言接口 | 从零开始Go语言
mysql查询字符串类型的字段使用数字类型查询时问题
以下程序实现从字符串str中删除第i个字符开始的连续n个字
Face to face summary 2
Implementation principle of instanceof
Fibula dynamic programming
访问数据库的时候出现错误 Operation not allowed for a result set of type ResultSet.TYPE_FORWARD_ONLY.详解