Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Atmel ARM7TDMI datasheet.1999.pdf
Скачиваний:
31
Добавлен:
23.08.2013
Размер:
1.45 Mб
Скачать

Format 18: unconditional branch

Figure 56. Format 18

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

1

1

0

0

 

 

 

 

Offset11

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Operation

This instruction performs a PC-relative Branch. The THUMB assembler syntax is shown below. The branch offset must take account of the prefetch operation, which

Immediate value

causes the PC to be 1 word (4 bytes) ahead of the current instruction

Table 29. Summary of Branch Instruction

THUMB assembler

ARM equivalent

Action

B label

BAL label (halfword offset)

Branch PC relative +/- Offset11 << 1, where label is PC +/-

 

 

2048 bytes.

Note: The address specified by label is a full 12-bit two’s complement address, but must always be halfword aligned

(ie bit 0 set to 0), since the assembler places label >> 1 in the Offset11 field.

Examples

here

B here

; Branch onto itself.

 

 

; Assembles

to 0xE7FE.

 

 

; (Note effect of PC offset).

 

B jimmy

; Branch to

’jimmy’.

 

...

; Note that

the THUMB opcode will

 

 

; contain the number of halfwords

 

 

; to offset.

 

jimmy

...

; Must be halfword aligned.

108 Instruction Set

Соседние файлы в предмете Электротехника