Re: Caaling assembly routine in c
- From: Lew Pitcher <Lew.Pitcher@xxxxxx>
- Date: Fri, 29 Apr 2005 12:11:33 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ravi Uday wrote:
>
>
> 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
I think you will find Appendix A.6.5 (Appendix J.5 in ISO 9989-1999) is
a list of "common extensions". In 9989-1999, asm() and the rest of
appendix J.5 is headed with this caveat
"The following extensions are widely used in many systems, but are not
portable to all implementations. The inclusion of any extension that
may cause a strictly conforming program to become invalid renders an
implementation nonconforming. Examples of such extensions are new
keywords, extra library functions declared in standard headers, or
predefined macros with names that do not begin with an underscore."
asm() falls into this category (it is J.5.10 in 9989-1999).
- --
Lew Pitcher, IT Specialist, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group
(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
iD8DBQFCcly0agVFX4UWr64RApMgAKCDR6AEjtfTcPlJNQmbrYSk6M3a4ACgo8S5
49ppFsLG8fI/O9/n3/J0lWM=
=8zhb
-----END PGP SIGNATURE-----
.
- References:
- Caaling assembly routine in c
- From: Sachin
- Re: Caaling assembly routine in c
- From: Ravi Uday
- Caaling assembly routine in c
- Prev by Date: Re: Value of EOF
- Next by Date: Re: Count maximum contiguous set bits in an integer .
- Previous by thread: Re: Caaling assembly routine in c
- Next by thread: Re: Caaling assembly routine in c
- Index(es):
Relevant Pages
|