360 Assembly/360 Instructions/DROP

The DROP pseudo-instruction is used to inform the assembler that a register previously declared in a USING pseudo-instruction is no longer available for use as a base register in instructions, and should not be used for that purpose. The assembler will revert to using any remaining register previously declared in a USING statement that has the smallest displacement from the target address.

The format for the DROP pseudo-instruction is:

DROP register1[,register2[,...]]

Register1, register2 etc. can be any of the general purpose registers 1 through 15 which was previously declared in a USING pseudo-instruction. As register 0 is effectively unavailable for use as a base register, it is virtually never used in a USING pseudo-instruction, and so would not be used in a DROP pseudo-instruction

Here is an example of an inline subroutine which sets up a temporary base register for the subroutine.

For the purpose of this example it is assumed that R14 is equated to 14, R15 is equated to 15 etc., to provide cross reference - see EQU Assembler pseudo-instruction)

* some typical assembler instructions showing comments to the right
        L     R15,=A(MOVE)                    Load sub-routine address into R15                   
        BALR  R14,R15                         Go to the sub-routine ===>
*                                             ....return here with return code in R15
*
*****************************************
*  Move the input to output             *
*****************************************
MOVE    EQU   *                               Start of a sub-routine called "Move"
        USING *,R15                           Tell the assembler reg. 15 points to
*                                             this address 
        MVC   OUTPUT,INPUT                    Move the input to the output area 
        SR    R15,R15                         Clear register contents (set Return code = 0)
        BR    R14                             return to caller
        DROP  R15                             Tell assembler we are no longer using
*                                             register 15 and resume using previous register
*
TABLE   DC    C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'   Table of letters of the alphabet
INPUT   DS    Cl80                            Input area
OUTPUT  DS    Cl80                            Output area

As the above example stated, the USING pseudo-instruction tells the assembler that a specific register contains the specified address, while the DROP pseudo-instruction tells the assembler that register can no longer be used, until it is specified in another USING pseudo-instruction.

 
360 Assembler Pseudo Instructions
Address Related ADATACNOPDROPEQULOCTRLTORGORGUSING
Code Related ALIASAMODECATTRCOM CSECTCXDDSECTDXDEND ENTRYEXTRNOPSYNRMODERSECTSTARTWXTRNXATTR
Data Related CCWCCW0CCW1DCDS
Conditional Assembly and Macro related ACTRAGOAIFAINSERTANOPAREADCOPYGBLA / GBLB / GBLCLCLA / LCLB / LCLCMACROMENDMEXITMNOTESETA / SETB / SETC
Listing, output and source related Comments*PROCESSACONTROLEJECTENDEXITCTLICTLISEQPOPPRINTPUNCHPUSHREPROSPACETITLE
 
360 Assembly Language
360 Family Introduction · Basic FAQ · 360 Family · 360 Architecture
360 Instruction Set 360 Instructions · Branch Instructions · Data Transfer Instructions · Control Flow Instructions · Arithmetic Instructions · Logic Instructions · Shift and Rotate Instructions · Other Instructions
Syntaxes and Assemblers 360 Assemblers· Pseudo Instructions
Instruction Extensions Floating Point · High-Level Languages