[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Assembler Language Reference

b (Branch) Instruction

Purpose

Branches to a specified target address.

Syntax

b target_address
ba target_address
bl target_address
bla target_address

Description

The b instruction branches to an instruction specified by the branch target address. The branch target address is computed one of two ways.

Consider the following when using the b instruction:

The b instruction has four syntax forms. Each syntax form has a different effect on the Link bit and Link Register.

Syntax Form Absolute Address Bit (AA) Fixed-Point Exception Register Link Bit (LK) Condition Register Field 0
b 0 None 0 None
ba 1 None 0 None
bl 0 None 1 None
bla 1 None 1 None

The four syntax forms of the b instruction never affect the Fixed-Point Exception Register or Condition Register Field 0. The syntax forms set the AA bit and the Link bit (LK) and determine which method of calculating the branch target address is used. If the Link bit (LK) is set to 1, then the effective address of the instruction is placed in the Link Register.

Parameters

target_address Specifies the target address.

Examples

  1. The following code transfers the execution of the program to there :
    here: b there
          cror 31,31,31
    # The execution of the program continues at there.
    there:
  2. The following code transfers the execution of the program to here and sets the Link Register:
            bl here
    return: cror 31,31,31
    # The Link Register now contains the address of return.
    # The execution of the program continues at here.
    here:

Related Information

Branch Processor.

Branch Instructions.


[ Previous | Next | Contents | Home | Search ]