Naveen Kumar

Basic doubts in assembly programming

Discussion created by Naveen Kumar on Oct 31, 2007
Latest reply on Nov 2, 2007 by CrasyCat
I am programming on msc8144, sc3000 architecture.

    In assembly programming can someone explain stack based calling convention?
Mainly  I would like to know how offsets (from stack pointer) for input arguments and local variables is computed.

void f1()
{
 word16 ar1[ ];
 word16 ar2[ ];
word16 ar3[ ];
word16 i,j,k;
/* function body*/
f2(ar1[ ], ar2[ ], ar3[ ], i, j ,k);
/* function body*/
}

f2(word16 a1[ ], word16 a2[ ], word16 a3[ ], word16 i, word16 j, word16 k)
{
 word16 b1[ ];
word16 b2[ ];
word16 b3[ ];

/*function body*/
}

Now if I want to write function f2 in assembly, how to create memory to store temporary arrays b1, b2, b3.
how to access input arguments to the function.

It would be helpful if someone can provide resource links, where assembly programming examples are given.

Thank you
Naveen

Outcomes