This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

calling function in different .S file problem.


Hi all:
   I have wrote two assembly file: a.S and b.S  and c.c

In b.S file:
   .global function_a
function_a:
	xxxx
	mov xxx
                add xxx
                 xxx


in c.c file
void c_function(void)
{
     // do something here
}


in a.S file:
   Get_Address function_a   ; get the address of function_a into a register
r0
   call r0   ; try to call function_a defined in b.S file
   // but can't invoke the function_a

  Get_Address c_function  ; get the address of c_function into a register r0
  call r0    ; try to call the c_function defined in c.c file
   // succeed in callng the c function here

what's the problem that I can't call a function from another .S file while I
can call the function from .C file in assembly file?

Thanks a lot






-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]