AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Syntax:          B {<cond>} <address>
Operation:     Jump to specified address
Flags:          Unaffected

This instruction is analogous to the BASIC GOTO statement - it makes the processor break off from its normal sequential execution of instructions and jump to a new instruction at a designated location.

When used in conjunction with the normal condition codes, this instruction becomes the basis of conditional branching.

Example:
.loop     
SUB  R0,R0,#1          ; R0 = R0 - 1
CMP  R0,#0          ; is R0 = 0?
BNE  loop          ; if not, go back to start of loop

Note that a branch forward past 0xFFFFFFFF, or backwards past 0x00000000, is unpredictable.

[sh-index] Back to list of manuals