Posts

Showing posts from December, 2011

Function call and stacks for Calling Conventions

Image
When a function is called arguments are passed to the called function by different means, like stacks ,registers. Similarly return is either done by stack or register, According to function calling conventions the compiler design the assembly code from c/cpp codes to pass arguments to called function. It also specify the stack handling of the portion used by the function. In x86 stack normally grow downward. EBP keeps track of the base of the frame(frame pointer),and ESP keeps track of the top of the stack.EAX have the return value. In PPC stack pointer is r1,Base pointer is r0,r3 is the return register. As I blogged before on PPC register classification . (from wikipedia) The C function Calling convention define following things Order in which arguments are pushed on the stack. Who is responsible for stack clean-up process either callee or caller function after call complete. Name decorating for individual function before linking. Available call c

Recent Liking

Image
Lately hearing RD barman and kishore's Songs. Seem like I becoming romantic .Though I like Mehdi Hassan and Gullam Ali also. The Guy Khurram Imtiaz has uploaded most of the best videos of kishore ,nushrat, ghulam ali etc check his playlists. http://www.youtube.com/user/KhurramDBG#g/p