Convert C to assembly

Status
Not open for further replies.

KH

Junior Member level 1
Joined
Nov 1, 2004
Messages
15
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
103
convert c to assembly

In C command syntax, n++ is equivalent to n=n+1, but if convert to assembly will it be the same interms of code length and processing time ?
 

convert c to asm

Just give incerement instruction of your processor and find cycle time clock freq..... !!
 

convert c to assembler

That would be compiler dependent. Compiling n=n+1 as an increment instruction is one of the rudimentary optimizations, as is using a shift for a multiplication by a power of 2 and ignoring do nothing statements ( n=n+0 or n=n*1)

Some compilers have switches to control the degree of optimazation.

Compilers also usually have switches to generate an assembly listing of the code they generate. Reading this listing can be a real eye opening experience.
 

convert command to assembly

It will depend upon complier you using.
 

how to convert c to assembly

No ... Compiler has some over head .. Assembly will be faster ........
 

convert c assembly increment

Most of the compiler supports assembly listing use compiler switch to generate assembly see the simple inc operation produces quite a few code... it also depends on target processor .....
 

    KH

    Points: 2
    Helpful Answer Positive Rating
asm convert to

KH said:
In C command syntax, n++ is equivalent to n=n+1, but if convert to assembly will it be the same interms of code length and processing time ?


If the compiler treats n=n+1 as the syntax of n=n+x, then maybe it makes a difference, n++ only need register increment, but n=n+1 will require direct addition of a constant.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…