05.02.2013 Views

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Assembler syntax<br />

BL{X} <br />

where:<br />

Instruction Details<br />

See St<strong>and</strong>ard assembler syntax fields on page A8-7. An <strong>ARM</strong> BLX (immediate) instruction<br />

must be unconditional.<br />

X If present, specifies a change of instruction set (from <strong>ARM</strong> to Thumb or from Thumb to<br />

<strong>ARM</strong>). If X is omitted, the processor remains in the same state. For ThumbEE code,<br />

specifying X is not permitted.<br />

The label of the instruction that is to be branched to.<br />

For BL (encodings T1, A1), the assembler calculates the required value of the offset from the<br />

PC value of the BL instruction to this label, then selects an encoding that sets imm32 to that<br />

offset. Permitted offsets are even numbers in the range –16777216 to 16777214 (Thumb) or<br />

multiples of 4 in the range −33554432 to 33554428 (<strong>ARM</strong>).<br />

For BLX (encodings T2, A2), the assembler calculates the required value of the offset from<br />

the Align(PC,4) value of the BLX instruction to this label, then selects an encoding that sets<br />

imm32 to that offset. Permitted offsets are multiples of 4 in the range –16777216 to 16777212<br />

(Thumb) or even numbers in the range −33554432 to 33554430 (<strong>ARM</strong>).<br />

Operation<br />

if ConditionPassed() then<br />

EncodingSpecificOperations();<br />

if CurrentInstrSet == InstrSet_<strong>ARM</strong> then<br />

next_instr_addr = PC - 4;<br />

LR = next_instr_addr;<br />

else<br />

next_instr_addr = PC;<br />

LR = next_instr_addr : ‘1’;<br />

if to<strong>ARM</strong> then<br />

SelectInstrSet(InstrSet_<strong>ARM</strong>);<br />

BranchWritePC(Align(PC,4) + imm32);<br />

else<br />

SelectInstrSet(InstrSet_Thumb);<br />

BranchWritePC(PC + imm32);<br />

Exceptions<br />

None.<br />

Branch range before <strong>ARM</strong>v6T2<br />

Before <strong>ARM</strong>v6T2, J1 <strong>and</strong> J2 in encodings T1 <strong>and</strong> T2 were both 1, resulting in a smaller branch range. The<br />

instructions could be executed as two separate 16-bit instructions, as described in BL <strong>and</strong> BLX (immediate)<br />

instructions, before <strong>ARM</strong>v6T2 on page AppxG-4.<br />

<strong>ARM</strong> DDI 0406B Copyright © 1996-1998, 2000, 2004-2008 <strong>ARM</strong> Limited. All rights reserved. A8-59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!