BSB, JSB SUBROUTINE INSTRUCTIONS JUMP, BRANCH TO SUBROUTINE
Purpose |
transfer control to subroutine |
Format |
opcode displ.bx branch to subroutine opcode dst.ab jump to subroutine |
Operation |
-(SP) ß PC; PC ß PC + SEXT (displ); branch to subroutine PC ß dst; jump to subroutine |
Condition codes |
N ß N; Z ß Z; V ß V; C ß C; |
Exceptions |
none |
Opcodes |
10 BSBB Branch to Subroutine with Byte Displacement 30 BSBW Branch to Subroutine with Word Displacement 16 JSB Jump to Subroutine |
Description |
PC is pushed on the stack as a longword. For branch, the sign-extended branch displacement is added to PC and PC is replaced by the result. For jump, PC is replaced by the destination operand. |
Notes |
Since the operand specifier conventions cause the evaluation of the destination operand before saving PC, JSB can be used for co routine calls with the stack used for linkage. The form of such a call is JSB *(SP)+. |