【发布时间】:2011-08-05 16:18:45
【问题描述】:
我写了一个 C 程序,我需要在 MIPS 汇编代码中看到它。
如何安装或操作将 *.c 文件转换为 *.txt 或 *.something_else 的软件以查看其 MIPS 汇编代码?
我的操作系统是 Linux。
非常感谢!!
顺便说一句,我的代码是:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 128
int main ()
{
char mychar , string [SIZE];
int i;
int count =0 ;
printf ("Please enter your string: \n\n");
fgets (string, SIZE, stdin);
printf ("Please enter char to find: ");
mychar = getchar();
for (i=0 ; string[i] != '\0' ; i++ )
if ( string[i] == mychar )
count++;
printf ("The char %c appears %d times\n" ,mychar ,count);
return 0;
}
【问题讨论】:
-
只是在控制台写 gcc -S ?它会给我什么?
-
对不起。我误解了这个问题:我认为您可以将代码编译到目标平台。 评论已删除
标签: c compiler-construction assembly mips