Coprocessors may have up to 16 directly addressable registers, C0-C15.
The memory address can be expressed in one of three ways, as shown above. In the first, pre-indexed form, an ARM register, Rn, holds the base address to which an offset can be added if necessary. Writeback of the effective address to Rn can be enabled using !. The offset must be divisible by 4, and within the range -1020 to 1020 bytes. With the second, post-indexed form, write-back of Rn+offset to Rn after the transfer, is automatic. Alternatively, a program-or-register-relative-expression can be used, in which case the assembler will generate a PC- or register-relative, pre-indexed address; if it is out of range an error will result.
op{condition}{L} CP#,Cd,[Rn {,#offset}]{!}
[Rn],#offset
L appended to the instruction specifies a long transfer; otherwise a short transfer takes place. The meaning of this is coprocessor-specific.
CPOp represents the coprocessor operation to be performed (four bits); details of such operations are coprocessor-specific and can be found in the appropriate datasheet. The operation is performed on CRn and CRm and the result written to CRd. The second, optional, CPOp2 field allows further variations on the operation (three bits).
CDP{condition} CP#,CPOp,CRd,CRn,CRm{,CPOp2}
CPOp is a 3-bit constant which specifies which variant of the instruction to perform. The selected operation is performed using the coprocessor registers Cn and Cm, and the result transferred to the ARM register Rd. If R15 is specified as the destination, only bits 28-31 of the result are transferred and are used to set the N, Z, C and V flags in the PSR without affecting the program counter. CPOp2, where present, is a 3-bit constant which sets the ARM condition flags, supporting the further coprocessor-specific sub-operations.
op{condition} CP#,CPOp,Rd,Cn,Cm{,CPOp2}
MRC is often used to read a coprocessor's status register(s), while MCR is used to write its control register(s). MRC, with R15 as the destination, supports execution of ARM code conditional on the result of an earlier coprocessor operation, (e.g. floating point compare).