Skip to main content

IAR Embedded Workbench for RX 5.20

--lock

In this section:
Syntax
--lock={Ri|Rj,Rk|Rm-Rp}
Parameters

Ri|Rj,Rk|Rm-Rp

The register(s) to lock

Description

Use this option to lock one or several of the registers R8R13 so that they cannot be used by the compiler but can be used for global register variables. To maintain module consistency, make sure you lock the same registers in all modules. By default, no registers are locked.

Example
--lock=R10

--lock=R8,R12,R13

--lock=R10-R13
--lock=R8,R11-R13
See also

Register locking

Caution

Project>Options>C/C++ Compiler>Code>Lock registers