B[condition] target
其中:
condition |
16 個條件之一。請參閱條件程式碼狀態 |
target |
目標地址,範圍是 [-256..+254] 位元組 |
此格式的 B 指令執行到指定 target 的條件分支。B 指令沒有返回點;因此不儲存返回地址。condition 必須是有效值;否則將指令當作 NOP。
無運算元。
N |
Z |
C |
V |
Q |
S |
I |
F |
T |
T |
T |
T |
T |
|
|
|
|
|
15 |
14 |
13 |
12 |
11 |
|
8 |
7 |
|
0 |
1 |
1 |
0 |
1 |
condition |
target |
1 ;@.text
2 ;@.globl funb
3 ;@.align 0
4 ;
5 AREA example,CODE,READONLY
6 CODE16
7
8 label1
9 ; Example 1
10 ; cross is a section of code within
11 ; current subroutine
12 00000000 F7C2 crossMOV R2, #Ox2
13 00000002 1C13 ADD R3, R2, #Ox6
14 00000004 D500 BPL cross2
15
16 ; Branch unconditionally to label
17 ; cross which is within 256 bytes
18 00000006 DE00 BAL cross
19 cross2
20
21
22 ; example2
23 ; Branch to label1 which is within
24 ; 256 bytes if Condition Code flags
25 ; set as NE
26 ; label1 is a section of code within
27 ; current subroutine
28 00000008 D100 BNE label1