Question:
Hi! my question is regarding to the conversion of C-language code to Assembly Language code?
Shoaib Ans
2006-11-18 00:09:25 UTC
i heard from my teacher that u can easily convert C-laguage code into Assembly language code (.asm file) by writting just one command in dos mode i.e c:\>tc -b *.cpp this command will automatically generate .asm file with some other files i tried it but it didn't work so vat will be the way to decode c-language file into .asm file?
Three answers:
Mn
2006-11-18 00:46:18 UTC
It depends on the system you are using. All C compilers create assembly code which is then passed to an assembler. There is usually an option to create the assembly code but not assemble it.



If you give me an idea whuch OS?compiler you are using I can probably tell you exactly how to do it.



For example gcc -S will only produce assembler output
F.G.
2006-11-18 18:35:28 UTC
I assume you're using Turbo C. Then try running tc -S *cpp instead. According to the manual ( http://bdn.borland.com/article/20997 ) this should produce asm code.
klimczyk
2016-10-22 11:17:19 UTC
this could nicely be a function call GCD (superb worry-unfastened Denominator) that takes in 2 integers as parameters, x and y. x is set to particularly the fee of x y is set to absolute fee of y next is a do-jointly as loop, so it is going to run with the aid of this loop a minimum of as quickly as in the previous checking the top situations; interior the loop: and integer n is set to the fee of x modulus y, that's the the remainder of x divided via y. x is then set to equivalent y y is now set to equivalent n now you examine if y is larger than 0, if specific, do the loop returned, if no, go out the loop and return the fee of x end function


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...