Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert C to ASM

Status
Not open for further replies.

sedef

Programmer
Jan 5, 2005
2
TR
I can't convert the C++ funct?on to ASM

the code is

for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
y=x*h[i-j]
 
Modern compilers are already adept at turning code into assembler, so I usually start with that.

Create a small source file containing just the code you're interested in, then do
[tt]gcc -S prog.c[/tt]

This will produce the corresponding assembler file for that source file.

Look in your compiler documentation to see if it has an equivalent command line option.

--
 
Hi sedef,

it occurs to me many different solutions to that, you can use registers, you can use memory, you can use stack. Post what you have so far and we will gladly look for errors. Also check this instructions:

push
pop,
jnz,
jz,

If this is an _asm function embedded in C code, you can name your variables (like i, j and n) in C and then use them in your assembly code,


regards,


Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top