简体   繁体   English

如何在 Linux 中打开 .s 程序集文件?

[英]How I open .s assembly file in Linux?

I wrote my c program add.c, then preprocessed with cpp, then compiled with CC to obtain an add.s file.我写了我的c程序add.c,然后用cpp预处理,然后用CC编译得到一个add.s文件。 Now I would like to open it to see the assembly code.现在我想打开它看看汇编代码。 Can't find a way to do it.找不到办法做到这一点。

The .s files are basically assembler source files, so you can pretty much open them in whatever tool you used to create the .c files in the first place. .s文件基本上是汇编文件,因此您几乎可以使用任何用于创建.c文件的工具打开它们。

In other words, mere mortals will opt for Notepad++ or Emacs , but the true intelligentsia will use Vim :-)换句话说,凡人会选择Notepad++Emacs ,但真正的知识分子会使用Vim :-)

For getting .s file.用于获取 .s 文件。 if you have main.cpp file , just complile with g++ -S main.cpp for getting main.s file.如果您有 main.cpp 文件,只需编译g++ -S main.cpp 即可获取 main.s 文件。

Now you can open with vim main.s现在你可以用vim main.s打开

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM