call stack's order of parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

What are the rules of a call stack regarding the order
in which parameters are placed? Program 1 creates the
call stack (pointer to "HELLO", pointer to
"ANDRE_KIRCHNER", 0xFF), while Program 1 creates the
call stack (pointer to "ANDRE_KIRCHNER", pointer to
"HELLO", 0xFF).

Thanks in advance,

Andre

##############################################################
PROGRAM 1:
##############################################################
#include <stdio.h>

void function(char * sentenceA, char * sentenceB, int
number)
{

}

int main()
{
   function("ANDRE_KIRCHNER", "HELLO", 0xFF);

   return 0;
}

##############################################################
ASSEMBLER CODE 1:
##############################################################

        .file   "main.c"
        .text
.globl function
        .type   function, @function
function:
        pushl   %ebp
        movl    %esp, %ebp
        popl    %ebp
        ret
        .size   function, .-function
        .section        .rodata
.LC0:
        .string "HELLO"
.LC1:
        .string "ANDRE_KIRCHNER"
        .text
.globl main
        .type   main, @function
main:
        leal    4(%esp), %ecx
        andl    $-16, %esp
        pushl   -4(%ecx)



       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux