Flow-control structures: Difference between revisions

Line 24:
</lang>
===Branch and Link (BAL)===
To perform a 'call' to a subroutine. The first register (r14 in the example) at execution time is the next sequential address to allow a 'return'.
<lang 360asm>
BALLA 14 15,SINUSX callload in reg15 address of function SINUSX
BALR 14,15 call the subroutine atSINUX theand place address foundRETPNT in register 15reg14
RETPNT EQU *
SINUSX EQU * subroutine SINUSX
...
BR 14 return to caller
</lang>
 
1,392

edits