xiluo67

导航

ARMV8 short notes

  • offset addressing
  • pre-index addressing

define like:

load the compass content of the operand 2 to operand 1, then update the operand 2.

ldr r1, [r2, #2]!       r1 = *(r2 + 2); r2 += 2
  • post-index addressing

define like:

use the content of operand 2 to update operand 1, then change the content of operand 2 by using operand 3.

ldr r1, [r2], #2            r1 = *r2; r2 += 2

  Compare to pre-index addressing, it does not need "!" to force the updating process.

  • pc-relative addressing
The target label must be located within ±4 kilobytes of the ldr instruction.
ldr r1, lable_offset
where the label_offset will be calculated by the assembler.
 
For both the second and the third one can accelerate the process for handling array elements, since the array data structures be like in C.

posted on 2022-07-24 15:34  xiluo67  阅读(16)  评论(0编辑  收藏  举报