ARM 아키텍처에서는 코프로세서와 레지스터 간의 데이터 전송을 위한 MRC
(Move to Coprocessor from ARM Register) 및 MCR
(Move to ARM Register from Coprocessor) 명령어를 제공한다. 이 글에서는 MRC
와 MCR
명령어에 대해 알아본다.
Coprocessor register transfer instructions
Syntax
<MCR|MRC>{cond} p#,<expression1>,Rd,cn,cm{,<expression2>}
MRC
: coprocessor 에서 register로 이동MCR
: register 에서 coprocessor로 이동{cond}
p#
: coprocessor 넘버<expression1>
Rd
cn and cm
<expressions2>
Examples
MRC p2,5,R3,c5,c6 ; Request coproc 2 to perform operation 5
; on c5 and c6, and transfer the (single
; 32 bit word) result back to R3.
MCR p6,0,R4,c5,c6 ; Request coproc 6 to perform operation 0
; on R4 and place the result in c6.
MRCEQp3,9,R3,c5,c6,2 ; Conditionally request coproc 3 to
; perform operation 9 (type 2) on c5 and
; c6, and transfer the result back to R3.