Subtract from PC subtracts an immediate value from the Align(PC, 4) value to form a PC-relative address, and writes the result to the destination register. ARM recommends that, where possible, software avoids using this alias.
This is an alias of ADR. This means:
It has encodings from the following instruction sets: A32 ( A2 ) and T32 ( T2 ) .
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
!= 1111 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | Rd | imm12 | |||||||||||||||||
cond |
SUB{<c>}{<q>} <Rd>, PC, #<const>
is equivalent to
and is the preferred disassembly when imm12 == '000000000000'.
15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
1 | 1 | 1 | 1 | 0 | i | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | imm3 | Rd | imm8 |
SUB{<c>}{<q>} <Rd>, PC, #<imm12>
is equivalent to
and is the preferred disassembly when i:imm3:imm8 == '000000000000'.
<c> |
<q> |
<imm12> |
Is a 12-bit unsigned immediate, in the range 0 to 4095, encoded in the "i:imm3:imm8" field. |
<const> |
An immediate value. See Modified immediate constants in A32 instructions for the range of values. |
The description of ADR gives the operational pseudocode for this instruction.
Internal version only: isa v00_79, pseudocode v34.2 ; Build timestamp: 2017-12-19T15:42
Copyright © 2010-2017 ARM Limited or its affiliates. All rights reserved. This document is Non-Confidential.