嵌入式 ARM中CP的操作指令MCR/MRC详解

来源:互联网 发布:nvidia优化游戏好用么 编辑:程序博客网 时间:2024/04/30 08:01

1. MCR, 将ARM中normal register的值传向CP register.

format: mcr cpx, op1, src_reg, dst_reg1, dst_reg2, op2

cpx: Integer in the range 0~15 defining coprocessor.

op1: Integer in the range 0~7 selecting different coprocessorfunctions

src_reg: Integer in the range 0~15 defining GP register in theprocessor core containing the value to read or write

dst_reg1: Integer in the range 0~15 defining the targetcoprocessor register.

dst_reg1: integer in the range 0~15 selecting across banks of 16coprocessor registers

op2: integer in the range 0~7 selecting different coprocessorfunctions.

e.g. mcr p15, 0, r0, c7, c7, 0

explain: 此操作将r0中的值传入cp15的c7中

2. MRC, 将ARM中CP register的值传向normal register 中。

format: mrc cpx, op1, dst_reg, src_reg1, src_reg2, op2

e.g. mrc p15, 0, r0, c1, c0, 0

explain: 此操作将p15中c1和c0的值存入到r0中

原创粉丝点击