Thank you very much. Now i got some idea , and am on the track.
I have some more doubts.
My sample application look like this.
----------------------------------------------------------------------------------------------------------------------------------------------------
File name: main.c
#include<stdio.h>
int add(int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int,int);
int main()
{
int a = add(1,2,3,4,5,6,7,8,9,0,1,2,3,4,5,6,7,8,9,0);
printf("The sum is = %d\n",a);
return 0;
}
int add(int a,int b,int c,int d,int e,int f,int g,int h,int i,int j,int k,int l,int m,int n,int o,int p,int q,int r,int s,int t)
{
int sum = a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t;sum = sum+t+s+o+j;sum = add_asm(sum,g,0,0,0);sum = sum+f+g+h+i+j+k+l+m+n+o;
return sum;
}
File name : assembly.asm
SECTION .text
global _add_asm
_add_asm
;pragma stack_effect _add_asm,2 ==> commented stack_effect directive (i just put 2 as the value, i donno how to set that value)
add d0,d1,d0
rts
---------------------------------------------------------------------------------------------------------------------------------------------------------------
1) Given " -enable-stack-effect " option in the C/C++ linker .
2) successfully build the above test project.
3) viewed the output .map file
4) There is no stack effect entry for my _add_asm function, but all the C function routines have the same.
5) Why the assembly routines didn't had the stack_effect option even if it is explicitly given in the assembly file itself.
6) Also , should the linker will take the ";pragma stack_effect" (It is commented right?) or not?
7) Also how can give the stack size in the above ;pragma sentence ?
8) I referred all of the above sentence you have mentioned. But i havn't got any details of stack effect , just a one page explanation.
9) Should i need to give any extra options to enable stack effect entry in map file for my own assembly functions?
10) How can i realize the effect of this stack_effect ;pragma by debugging
11) Can you please give me XXX value in the the ;pragma stack_effect _add_asm ,XXX , and how you calculated that?
Expecting your detailed reply
/Kanu__