01.12.2014 Views

ARM Processor Instruction Set

ARM Processor Instruction Set

ARM Processor Instruction Set

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.

<strong>ARM</strong> <strong>Processor</strong> <strong>Instruction</strong> <strong>Set</strong><br />

5.3.3 Assembler syntax<br />

B{L}{cond} <br />

Items in {} are optional. Items in must be present.<br />

{L} requests the Branch with Link form of the instruction. If<br />

absent, R14 will not be affected by the instruction.<br />

{cond}<br />

<br />

is a two-char mnemonic as shown in ➲Figure 5-2: Condition<br />

codes on page 5-3 (EQ, NE, VS etc). If absent then AL<br />

(ALways) will be used.<br />

is the destination. The assembler calculates the offset.<br />

5.3.4 Examples<br />

here BAL here ;assembles to 0xEAFFFFFE (note effect of PC<br />

;offset)<br />

B there ;ALways condition used as default<br />

CMP R1,#0 ;compare R1 with zero and branch to fred if R1<br />

BEQ fred ;was zero otherwise continue to next instruction<br />

BL sub+ROM ;call subroutine at computed address<br />

ADDS R1,#1 ;add 1 to register 1, setting CPSR flags on the<br />

BLCC sub ;result then call subroutine if the C flag is<br />

;clear, which will be the case unless R1 held<br />

;0xFFFFFFFF<br />

Preliminary - Unrestricted<br />

<strong>ARM</strong>7500 Data Sheet<br />

<strong>ARM</strong> DDI 0050C<br />

5-5

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

Saved successfully!

Ooh no, something went wrong!