Understanding disassembly x86 + understanding function call + parameter pass and stack frame
Nilesh.Tayade at netscout.com
Fri Aug 9 15:19:55 EDT 2013
> -----Original Message-----
> From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-
> bounces at kernelnewbies.org] On Behalf Of Matthias Brugger
> Sent: Tuesday, August 06, 2013 7:14 PM
> To: nidhi mittal hada
> Cc: kernelnewbies at kernelnewbies.org
> Subject: Re: Understanding disassembly x86 + understanding function call +
> parameter pass and stack frame
> 2013/8/6 nidhi mittal hada <nidhimittal19 at gmail.com>:
> > Hi All,
> > I am using crash tool to analyze core dump obtained from red hat linux
> > on
> > x86_64 platform.
> > Putting some of the doubts..
> > a)like which sequence the parameters, return address, etc are pushed
> > on stack?
May be you would like to take a look at below link:
http://www.cs.virginia.edu/~evans/cs216/guides/x86.html [Section: Calling Convention] has the exact answer to your question.
> > b)Which registers are used, if some registers play some spl. role ?
You also might want to read the tutorials:
This tutorial is in four parts. Part-2 has information on all the registers and their roles.
> > c)lets say for a program a.c i use gcc -S a.c ...do we have some other
> > command to generate somewhat more clear assembly code, may be with
> > some comments in English
Take a look at information on objdump command. You can compile the debug binary of the code and use objdump with certain options on that binary- this will dump the assembly code along with inline C code.
> > Any kind of help in understanding this will be appreciated ..
> > Thanks
> > Nidhi
Hope it helps.
More information about the Kernelnewbies