EasyManua.ls Logo

Intel i960 - Asm Functions

Intel i960
347 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
i960 Processor Compiler User's Guide
7-70
7
"0" (new_pc) is the second
input-spec
. It is operand 2. The "0"
constraint indicates that this operand and operand 0 must be allocated
to the same register. This is required because in the
asm-template
this register is both a source and a destination. Note that operand 2 is
not referenced in the
asm-template
, but that the reference to operand
0 is also the use of operand 2 as specified by the
"0" constraint.
Note that this example shows how the 0-9 constraint is used to match an
input to an output operand when a src/dst operand is needed in an
asm-
template
. This example also shows that input-only operands (such as
mask) can be freely referenced multiple times in an
asm-template
without needing to be specified multiple times in the
in-list
.
If you are writing a header file that should be includable in ANSI C
programs, use
__asm__ instead of asm and __volatile instead of
volatile. See the Alternate Keywords section for more information.
asm Functions
An asm function definition is a special form of a prototyped function
definition. The keyword
asm preceding the return-type specifier identifies
an
asm function definition. An asm function definition can occur
anywhere a C function definition can occur. However, the definition of an
asm function must precede any call to it.
NOTE. An asm statement or asm function should not issue an assembler
directive that changes the object module section to something other than
.text. The compiler assumes the asm statement leaves the assembler in
the
.text section.
When processing an
asm function call, the compiler generates additional
instructions for loading registers, for other operations needed to pass
parameters, and for acceptance of a return value. A call to an
asm
function is not a true function call, however, because the compiler expands
the assembly-language body of the function inline.

Table of Contents

Related product manuals