BX - Branch and ExchangeBX[condition] dest
where:
|
condition |
One of 16 conditions. Refer to Condition Code Status. |
|
dest |
Destination register |
The BX instruction branches to the specified dest containing an ARM* or Thumb* instruction and optionally executes it. To select an ARM instruction bit[0] of the destination register needs to be set to 0. To select a Thumb instruction bit[0] of the destination register needs to be set to 1. The condition needs to be a valid value; else the instruction is rendered an NOP.
No operands.
|
N |
Z |
C |
V |
Q |
S |
I |
F |
T |
|
T |
T |
T |
T |
|
|
|
|
M |
|
31 |
|
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
|
16 |
15 |
|
12 |
11 |
|
8 |
7 |
6 |
5 |
4 |
3 |
|
0 |
|
condition |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
SBO |
SBO |
SBO |
0 |
0 |
0 |
1 |
dest_ addr |
||||||||||
1 ;@.text
2
3 ;@.globl funcbx
4
5 ;@.align 0
6
7 ;@ * * * BX * * *
8
9
10 AREA example, CODE, READONLY
11 label1
12 00000000 E3A0B001 MOV R11, #1
13 00000004 E2AB0001 ADC R0, R11, #1
14 00000008 E4107000 LDR R7, label2
15
16 00000012 E12FFF17 BX R7
17
18 00000016 E3A0B001 MOV R11, #1
19 00000020 E21B0001 ANDS R0, R11, #1
20
21 label2
22 DCD 0xdeadbeef
23 DCB "string"
24
25 END 26