| |||
| Home > Using the Inline and Embedded Assemblers of the ARM Compiler > Inline assembler BL and SVC input parameter list in C and C++ code | |||
The BL and SVC instructions of the
inline assembler have the following format:
SVC{cond} svc_num, {input_param_list}, {output_value_list}, {corrupt_reg_list}
BL{cond} function, {input_param_list}, {output_value_list}, {corrupt_reg_list}
specifies
the expressions or variables that are the input parameters to the function
call or input_param_listSVC instruction, and the physical registers
that contain the expressions or variables. They are specified as
assignments to physical registers or as physical register names. A
single list can contain both types of input register specification.
The inline assembler ensures that the correct values are present
in the specified physical registers before the BL or SVC instruction
is entered. A physical register name that is specified without assignment
ensures that the value in the virtual register of the same name
is present in the physical register. This ensures backwards compatibility
with existing inline assembly language code.
For example, the instruction:
BL foo, { r0=expression1, r1=expression2, r2 }
generates the following pseudocode:
MOV (physical) r0, expression1MOV (physical) r1, expression2MOV (physical) r2, (virtual) r2BL foo
By default, if you do not specify any input
parameters, registers input_param_list r0 to r3 are used
as input parameters.
It is not possible to specify the lr, sp,
or pc registers in the input parameter list.