You copied the Doc URL to your clipboard.

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}

input_param_list specifies the expressions or variables that are the input parameters to the function call or SVC 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, expression1 MOV (physical) r1, expression2 MOV (physical) r2, (virtual) r2 BL foo

By default, if you do not specify any input_param_list input parameters, registers 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.