alice said:
hi all,
Can anybody please tell me that how an assembly language code can be
called from a program written in C?I mean what is the syntax for doing
this thing?
There are at least two ways to interpret the question.
The C syntax for calling a function written in assembly
language is exactly the same as for calling a function written
in ordinary C: you write the name of the function followed by
an open parenthesis, followed a (possibly empty) comma-separated
list of arguments, followed by a close parenthesis. The details
of how the assembly-implemented function obtains its arguments
(if any) and returns its value (if any) and jumps through whatever
linkage hoops the platform requires (if any) are specific to the
platform in question, and usually don't work exactly the same
way on other platforms. You'll need to consult your platform's
documentation for the details; they're really not part of C.
Some C implementations allow assembly code to be intermixed
with C code, so a "C and then some" function can contain both
C and assembly source statements. If the implementation permits
such an extension, the details are implementation-specific and
not portable, and you'll need to consult your documentation --
once again, this really isn't C. It isn't really assembly,
either, but a mixed-language patois, a sort of trade argot
with little structure and less grammar but occasionally useful
nonetheless.