ARM中CP的操作指令MCR/MRC詳解

1. MCR, 將ARM中normal register的值傳向CP register.

    format: mcr cpx, op1, src_reg, dst_reg1, dst_reg2, op2 /* op, operation code; src, source; dst, destination */

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

                op1: Integer in the range 0~7 selecting different coprocessor functions

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

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

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

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

    e.g.      mcr p15, 0, r0, c7, c7, 0 /* flush V3/V4 cache */

    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中

發佈了26 篇原創文章 · 獲贊 5 · 訪問量 20萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章