360 Assembly/Comments

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

A comment in 360 Assembly is a portion of text that is not processed by the assembler and is used by the programmer to add a description to the code. If a line of code begins with one (or more) asterisks ("*), the rest of the line is treated as a comment

Examples: 

* This is a comment line because it begins with an asterisk
**** This is a comment line also
************************************************
*     This is a comment 'box'                  *
************************************************

After a valid 360 instruction, after a single blank, everything else on the line is treated as a comment

Examples:  
(it is assumed that R14 is equated to 14, R15 is equated to 15 etc to provide cross reference - see EQUATE Assembler 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"
        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
*
TABLE   DC    C'ABCDEFGHIJKLMNOPQRSTUVWXYZ'   Table of letters of the alphabet
INPUT   DS    Cl80                            Input area
OUTPUT  DS    Cl80                            Output area