HLASM - BC = Branch on Condition
The opcode of the BC instruction is X'47'.
Usage
This instruction implements the IF function by conditionally skipping
a part of the program's logic. Alternatively it can be used to build a loop
by branching back.
- Conditionally branch forward to skip some logic.
- Conditionally branch backward to repeat some logic.
- Select a logic path by means of a branch table.
Arguments
- 4-bit condition mask (in the instruction).
- destination address (index, base, displacement).
Function
- The processor uses the PSW's two-bit condition code as an index into the
4-bit condition mask.
- If the selected mask-bit is one, then it branches to the address
specified in the second argument. If the bit is zero, then the processor
continues with the next instruction.
- The condition code does not change.
Special Cases
- None.
Related Instructions
- BCR branches to a location that is specified
in a register.
- BRC branches to a location whose address is
specified relative to the current instruction address.
- BRCL branches to a location whose address is
specified relative to the current instruciotn address.
- BCTR is intended for creating loops.
- BXLE and BXH are intended
for scanning tables.
Hardware
- All hardware supports the BC instruction.
Remarks
- The PSW's Amode setting determines how many bits are used for the
destination address.
- HLASM supports various so-called extended mnemonics that
have an implied mask value. For an overview please refer to the
list of extended mnemonics for BC.
- Some instructions will alter the condition code in the PSW, some won't.
When a BC instruction tests the condition code, it may have been set by
the preceding instruction, or it may have remained unchanged during the
execution of the last few instructions. Thus, it is possible that the
condition code was set quite a few instructions before being tested by the
current BC instruction.
Examples
YREGS * Define register names
...
BC B'1000',MY_LABEL * Branch in case....
...
BC B'1111',0(,R14) * Return to caller
...
MYLABEL DS 0H
...
To the Opcodes Overview.
To the English Homepage for Hlasm.com.
To the General Homepage for Bixoft and Hlasm.com.
This site is a member of WebRing.
You are invited to browse the
list of mainframe-loving sites.
|
|
Dinos are not dead. They are alive and well and living in data centers all
around you. They speak in tongues and work strange magics with computers.
Beware the dino! And just in case you're waiting for the final demise of
these dino's: remember that dinos ruled the world for 155-million years!
|
Dinos and other anachronisms
[ Join Now
| Ring Hub
| Random
|
<< Prev
|
Next >>
]
|
Below you find the logo of our
sponsor
and logos of the web-standards that this page adheres to.