In this article at OpenGenus, we have explained how to convert / compile a C or C code to Assembly code using GCC or G compiler.
Table of contents:
Convert C codeConvert C codeConvert C code
The command to convert a given C code to Assembly code is as follows:
gcc -S opengenus.c
This command will save the assembly code in a filename opengenus.s. The filename syntax is ".s".
For example, if this is your C code:
int main() { int a = 5, b = -1; int sum = a b; return 0;}
The corres...
Published on May 14, 2023 10:55