Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: airc on November 22, 2012, 05:18:05 pm

Title: AT&T asm help
Post by: airc on November 22, 2012, 05:18:05 pm
hi all
i've the following function and i want access to its parametres through the ebp register but the function always return 0

Code
int getParam(int x)
{
    int result;
   asm("mov 8(%ebp),%eax"); // copy x into eax
   asm("mov %eax, -4(%ebp)"); // copy eax into result
   return result;
}

i konw its not CB related , but i hope to get some help

thanks in advance
Title: Re: AT&T asm help
Post by: oBFusCATed on November 22, 2012, 05:27:31 pm
What do you expect to get as an answer other then a locked/deleted topic?

Search the internet or the manual of you compiler how to do this.