Re: Caaling assembly routine in c
- From: Ravi Uday <raviuday@xxxxxxxxx>
- Date: Fri, 29 Apr 2005 18:34:18 +0530
Sachin wrote:
Hi All,
I am working on MIPS architecture and I am compiling my project using GHS tool chain.
I want to call a assembly routine into c function. My code is like that:
.globl asm .ent asm
asm: ---- ---- .end asm
I am calling this routine in c function like that:
extern void asm(void);
void foo() { asm(); }
On compiling, error message comes that symbol asm unresolved.
Could any one tell that how I can do it for GHS.
Regards, Sachin
Hi,
There is not much said about assemby routines from C its more implementation specific stuff.
However this is what the C89 standard has to say -
A.6.5.10 The asm keyword
The asm keyword may be used to insert assembly-language code directly into the translator output. The most common implementation is via a statement of the form
asm ( character-string-literal );
So make sure you pass a character-string-literal as a param, not a void !
- Ravi
.
- Follow-Ups:
- Re: Caaling assembly routine in c
- From: Keith Thompson
- Re: Caaling assembly routine in c
- From: Lew Pitcher
- Re: Caaling assembly routine in c
- References:
- Caaling assembly routine in c
- From: Sachin
- Caaling assembly routine in c
- Prev by Date: struct and function-pointer casting
- Next by Date: main(int argc, char *argv[])
- Previous by thread: Re: Caaling assembly routine in c
- Next by thread: Re: Caaling assembly routine in c
- Index(es):
Relevant Pages
|