Sample program

The sample program included with High Level Assembler is described in this appendix. This program demonstrates some basic assembler language, macro, and conditional assembly features, most of which are unique to High Level Assembler. The highlighted characters in these descriptions refer to corresponding characters in the listing that precedes the descriptions.

For more details about this program, see ASMASAMP in the HLASM Installation and Customization Guide.
                                         High Level Assembler Option Summary                   (PTF R160   )   Page    1
                                                                                            HLASM R6.0  2015/02/21 20.03
  Overriding ASMAOPT Parameters -
    >* Input ASMAOPT Statement
    >sysparm(thisisatestsysparm),rxref
    >LIST(MAX)
  Overriding Parameters-  NOOBJECT,LANGUAGE(EN),SIZE(MAX),NOADATA,GOFF
  Process Statements-     OVERRIDE(NORENT)


  Options for this Assembly
3 Invocation Parms  NOADATA
                      ALIGN
                    NOASA
                      BATCH
                      CODEPAGE(047C)
                    NOCOMPAT
                    NODBCS
                    NODECK
                      DXREF
                      ESD
                    NOEXIT
                      FAIL(NOMSG,NOMNOTE,MAXERRS(500))
                      FLAG(0,ALIGN,CONT,EXLITW,NOIMPLEN,NOPAGE0,PUSH,RECORD,NOSUBSTR,USING0)
                    NOFOLD
3 Invocation Parms    GOFF(NOADATA)
                    NOINFO
3 Invocation Parms    LANGUAGE(EN)
                    NOLIBMAC
                      LINECOUNT(60)
2 ASMAOPT             LIST(MAX)
                      MACHINE(,NOLIST)
                      MXREF(SOURCE)
3 Invocation Parms  NOOBJECT
                      OPTABLE(UNI,NOLIST)
                    NOPCONTROL
                    NOPESTOP
                    NOPROFILE
                    NORA2
1 *PROCESS OVERRIDE NORENT
                      RLD
2 ASMAOPT             RXREF
                      SECTALGN(8)
3 Invocation Parms    SIZE(MAX)
                    NOSUPRWARN
2 ASMAOPT             SYSPARM(thisisatestsysparm)
                    NOTERM
                    NOTEST
                      THREAD
                    NOTRANSLATE
                      TYPECHECK(MAGNITUDE,REGISTER)
                      USING(NOLIMIT,MAP,WARN(15))
                    NOWORKFILE
                      XREF(SHORT,UNREFS)

  No Overriding DD Names
BIGNAME                                       External Symbol Dictionary                                       Page    2
Symbol   Type   Id     Address  Length   Owner Id Flags Alias-of                            HLASM R6.0  2015/02/21 20.03
A         SD 00000001
B_IDRL    ED 00000002                    00000001
B_PRV     ED 00000003                    00000001
B_TEXT    ED 00000004 00000000 000000F0  00000001   00
A         LD 00000005 00000000           00000004   00
PD2       SD 00000006
B_IDRL    ED 00000007                    00000006
B_PRV     ED 00000008                    00000006
B_TEXT    ED 00000009 00000000 00000814  00000006   00
PD2       CM 0000000A 00000000           00000009   00    A 
BIGNAME                                                                                                        Page    3
  Active Usings: None
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                               1 *PROCESS OVERRIDE(NORENT)
BIGNAME  Sample program.  1ST TITLE statement has no name, 2ND one does                                        Page    4
  Active Usings: None
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                               3 ***********************************************************************
                                               4 *                                                                     *
                                               5 *  Licensed Materials - Property of IBM                               *
                                               6 *                                                                     *
                                               7 *  5696-234                                                           *
                                               8 *                                                                     *
                                               9 *  Copyright IBM Corporation 1992, 2008 All Rights Reserved.          *
                                              10 *                                                                     *
                                              11 *  US Government Users Restricted Rights - Use, duplication           *
                                              12 *  or disclosure restricted by GSA ADP Schedule Contract              *
                                              13 *  with IBM Corp.                                                     *
                                              14 *                                                                     *
                                              15 ***********************************************************************
                                              16 * DISCLAIMER OF WARRANTIES                                            *
                                              17 *  The following enclosed code is sample code created by IBM          *
                                              18 *  Corporation. This sample code is licensed under the terms of       *
                                              19 *  the High Level Assembler license, but is not part of any           *
                                              20 *  standard IBM product.  It is provided to you solely for the        *
                                              21 *  purpose of demonstrating the usage of some of the features of      *
                                              22 *  High Level Assembler.  The code is not supported by IBM and        *
                                              23 *  is provided on an "AS IS" basis, without warranty of any kind.     *
                                              24 *  IBM shall not be liable for any damages arising out of your        *
                                              25 *  use of the sample code, even if IBM has been advised of the        *
                                              26 *  possibility of such damages.                                       *
                                              27 ***********************************************************************
00000000                00000000 000000F0     28 a        csect
                    R:8 00000000              29          using *,8
00000000 1BFF                                 30          sr    15,15      Set return code to zero
00000002 07FE                                 31          br    14          and return.
                                              33 **********************************************************************
                                              34 *              PUSH  and POP  statements                             *
                                              35 * Push down the PRINT statement, replace it, retrieve original       *
                                              36 **********************************************************************
                                              38          push  print     Save Default setting '  PRINT ON,NODATA,GEN'
                                         B    39          print nogen,data
00000004 0A23                                 40          wto   mf=(E,(1))                    Expansion not shown
 A 
The external symbol dictionary shows a named common statement. The named common section is defined in statement 257.
 B 
Statement 38: Save the status of the PRINT statement.

Statement 39: Modify the print options to DATA and NOGEN.

Statement 40: Macro call; the expansion (statements 41 and 44) is not printed.

Statement 45: All 28 bytes of data are displayed to the two-operand DC.

Statement 46: Restore earlier status of PRINT.

Statement 48: This statement is not printed. It is a nested macro call. The MCALL operand of the PRINT instruction or the PCONTROL assembler option control the printing of nested macro calls.

Statements 51: The generated output of the macro WTO is shown, but only two bytes of data are shown.

00000006 01230ABC0102030A                   C  45  dc x'123,ABC',(reallylongsymbol-transylvania)b'1,10,11,1010,1011,1100'
0000000E 0B0C0102030A0B0C
00000016 0102030A0B0C0102
0000001E 030A0B0C
                                              46          pop   print                   Restore default PRINT setting
                                              47          wto   mf=(E,(1))                    Expansion shown
00000022 0A23                                 51+         SVC   35                       ISSUE SVC 35               @L6A 01-WTO
00000024 01230ABC0102030A                     52  dc x'123,ABC',(reallylongsymbol-transylvania)b'1,10,11,1010,1011,1100'
                                              54 **********************************************************************
                                              55 *                     LOCTR  instruction                             *
                                              56 * LOCTR allows 'REMOTE' assembly of constant                         *
                                              57 **********************************************************************
00000040 5850 80AC               000000AC     59          l     5,constant
000000AC                000000AC 000000F0  D  60 deecees  loctr
000000AC 00000005                             61 constant dc    f'5'      Constant coded here, assembled behind LOCTR A
BIGNAME  Sample program.  1ST TITLE statement has no name, 2ND one does                                        Page    5
  Active Usings: a,R8
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
00000044                00000000 000000F0     62 a        loctr                Return to 1st LOCTR in CSECT A
                                              64 **********************************************************************
                                              65 *  3 operand EQUATE with forward reference in 1ST operand            *
                                              66 **********************************************************************
00000044 1812                                 68 a5       lr    1,2            L'A5 = 2, T'A5 = I
                                              69          print data
00000046 0000
00000048 413243F6A8885A30                     70 a7 dc l'3.1415926535897932384626433832795028841972' L'A7 = 16,T'A7 = L
00000050 338D313198A2E037
                                              71 &type    setc  t'a7
                                E             72 a8       equ   b5,l'a5,c'&type'
                         000000B0 00000002      +a8       equ   b5,l'a5,c'L'
 C 
Statements 45 and 52: Multiple constants are allowed in hexadecimal and binary DC operands, and neither symbol in the duplication factor has been defined yet. Definition occurs in statements 151 and 152.
 D 
Statements 60, 62 235, 248 and 253 show use of the LOCTR assembler instruction. This feature allows you to break down control sections into subcontrol sections. It can be used in CSECT, RSECT, DSECT, and COM sections. LOCTR has many of the features of a control section; for example, all the first LOCTR in a section is assigned space, then the second, and so on. The name of the control section automatically names the first LOCTR section. Thus LOCTR A is begun, or continued, at statements 28,62 and 254. The location counter value shown each time is the continued value of the LOCTR. Conversely, various LOCTR sections within a control section have common addressing as far as USING statements are concerned, subject to the computed displacement falling within 0 through 4095. In the sample, CONSTANT (at statement 61) is in LOCTR DEECEES but the instruction referring to it (statement 59) has no addressing problems.
 E 
Three-operand EQU. Here, we assign: (a) the value of B5 (not yet defined) to A8, (b) the length attribute of A5 to A8, and (c) the type attribute of A7 to A8. If no second or third operand is present in an EQU statement, the type attribute is U and the length attribute is that of the first term in the operand expression. Symbols present in the operand field must be previously defined. You cannot express the type attribute of A7 directly in the EQU statement. The EQU statement at 72 could have been written
a8        equ       b5,2,c'L'
a8        equ       b5,x'2',x'D3'
BIGNAME  Sample program.  1ST TITLE statement has no name, 2ND one does                                        Page    6
  Active Usings: a,R8
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                              74 **********************************************************************
                                              75 * Implicit declaration of locals &A, &C -- Use of SETC dup factor to *
                                              76 *   produce SETC string longer than 8, MNOTE in open code            *
                                              77 **********************************************************************
                                              79 &la8     seta  l'a8
                                         F    80 &ta8     setc  t'a8 
                                              81          mnote *,'Length of A8 = &LA8, Type of A8 = &TA8'
                                         G      +*,Length of A8 = 2, Type of A8 = L  
                                              83 &a       seta  2 
                                              84 &c       setc  (&a+3)'STRING,' 
                                         H    85          mnote *,'&&C has value = &c' 
                                                +*,&C has value = STRING,STRING,STRING,STRING,STRING,
                                              87 **********************************************************************
                                         I    88 * Examples of 4 byte self-defined terms, unary + and -               * 
                                              89 ********************************************************************** 
00000058 7FFFFFFFC1C2C3C4                     91          dc    a(2147483647,C'ABCD',X'ffffffff') 
00000060 FFFFFFFF 
00000064 181D                                 92          lr    -1+2,16+-3 
                        FFFFFFE8              94 X        equ   4*-6
 F 
Set symbols &LA8 and &TA8 have not been previously declared in LCL or GBL statements. Therefore, they default to local variable symbols as follows: &LA8 is an LCLA SET symbol because it appears in the name field of a SETA; &TA8 is an LCLC SET symbol because it is first used in a SETC.
 G 
MNOTEs can appear in open code. As such, they have all properties of MNOTEs inside macros, including substitution.
 H 
A SETC expression can have a duplication factor. The SETA expression must be enclosed in parentheses and immediately precede the character string, the substring notation, or the type attribute reference.
 I 
Statements 91 through 94 show 4-byte self-defining values and unary + and -. The value of X appears later in a literal address constant (see statement 337).
BIGNAME  Insert Programmer Macro in Source Stream now                                                          Page    7
  Active Usings: a,R8
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                              96 **********************************************************************
                                              97 *  Mixed keywords and positional parameters, extended AGO and AIF    *
                                              98 *     statements, declaration and use of subscripted SET symbols,    *
                                              99 *       Use of created SET symbols, extended SET statements          *
                                             100 **********************************************************************
                                         J   102          macro
                                             103          demo  &p1,&key1=A,&p2,&key2=1,&p3,&key3=3,&p4 
                                         K   104 &loc(1)  setc  '2','3'        &LOC is dimensioned LCLC by default 
                                             105          gblc  &xa(5),&xb(20),&xc(1)
                                             106          aif   ('&system_id'(1,3) eq 'VSE').vse 
                                         L   107          &p1   &syslist(4),&syslist(5),&syslist(6),mf=E 
                                             108          ago   .notvse 
                                             109 .vse     anop                 Use VSE WRITE macro parameters 
                                             110          &p1   &syslist(4),SQ,&syslist(6) 
                                             111 .notvse  anop 
                                             112 &n       seta  1 
                                         M   113          ago   (&key2).mnote1,.mnote2,.mnote3 
                                             114 &n       seta  2 
                                             115          mnote *,'&&KEY2 not 1,2, or 3---Use &&KEY3 in place of it' 
                                         N   116          aif   (&key3 eq 1).mnote1,                                    X
                                                                 (&key3 eq 2).mnote2,(&key3 eq 3).mnote3 
                                             117          mnote *,'Both &&KEY2 and &&KEY3 fail to qualify' 
                                             118          ago   .common 
                                             119 .mnote1  mnote *,'&&KEY&LOC(&N) = 1'
                                             120          ago   .common 
                                             121 .mnote2  mnote *,'&&KEY&LOC(&N) = 2' 
                                             122          ago   .common 
                                             123 .mnote3  mnote *,'&&KEY&LOC(&N) = 3' 
                                             124 .common  l     5,8(,10)       Note that opcodes, operands & comments 
                                             125 &xb(2) sr 9,10                  on MODEL statements 
                                         O   126 &(x&key1)(2) lm 12,13,=a(a5,x)    are kept in place unless displaced 
                                             127 &p2 st 7,&p3                        as a result of substitution 
                                             128          mend
                                             130 *****          DEMO  MACRO  instruction (call)
                                         P   132          gblc  &xa(1),&xb(2),&xc(3)
                                             133 &xa(1)   setc  'A','MISSISSIPPI' 
                                             134 &xb(1)   setc  'B','SUSQUEHANNA' 
                                             135 &xc(1)   setc  'C','TRANSYLVANIA' 
                                         Q   136          demo  key3=2,write,reallylongsymbol,                          M
                                                                a8+8*(b5-constant-7)(3),key1=C,(6),SF,                  N
                                                                 (8),key2=7 
00000066 1816                                141+         LR    1,6                               LOAD DECB ADDRESS      03-IHBRDWRS 
00000068 9220 1005      00000005             142+         MVI   5(1),X'20'               SET TYPE FIELD                  03-IHBRDWRS 
0000006C 5081 0008               00000008    143+         ST    8,8(1,0)                          STORE DCB ADDRESS      03-IHBRDWRS 
00000070 1BFF                                144+         SR    15,15                                               @L1A 03-IHBRDWRS 
00000072 BFF7 8031               00000031    145+         ICM   15,B'0111',49(8)             LOAD RDWR ROUTINE ADDR @L1A 03-IHBRDWRS 
00000076 05EF                                146+         BALR  14,15                        LINK TO RDWR ROUTINE   @L1C 03-IHBRDWRS 
                                             147+*,&KEY2 not 1,2, or 3---Use &KEY3 in place of it                        01-00000115 
                                             148+*,&KEY3 = 2                                                             01-00000121 
00000078 5850 A008               00000008    149+         l     5,8(,10)       Note that opcodes, operands & comments    01-00000124 
0000007C 1B9A                            R   150+SUSQUEHANNA sr 9,10             on MODEL statements                     01-00000125 
0000007E 98CD 8090               00000090    151+TRANSYLVANIA lm 12,13,=a(a5,x)    are kept in place unless displaced    01-00000126 
BIGNAME  Insert Programmer Macro in Source Stream now                                                          Page    8
  Active Usings: a,R8   
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                  HLASM R6.0  2015/02/21 20.03
00000082 5073 8098               00000098    152+reallylongsymbol st 7,a8+8*(b5-constant-7)(3)                          X01-00000127
                                                +                                    as a result of substitution
 J 
The macro DEMO is defined after the start of the assembly. Macros can be defined at any point and, having been defined, expanded, or both, can be redefined. The parameters on the prototype are a mixture of keywords and positional operands. &SYSLIST can be used. The positional parameters are identified and numbered 1, 2, 3 from left to right; keywords are skipped over in numbering positional parameters.
 K 
Statement 104 shows the extended SET feature (as well as implicit declaration of &LOC(1) as an LCLC). Both &LOC(1) and &LOC(2) are assigned values. One SETA, SETB, or SETC statement can then do the work of many.
 L 
Statement 107 is a model statement with a symbolic parameter in its operation field. This statement is edited as if it is a macro call; at this time, each operand is denoted as positional or keyword. At macro call time, you cannot reverse this decision. Even though it is treated as a macro, it is still expanded as a machine or assembler operation.
 M 
Statement 113 shows the computed AGO statement. Control passes to .MNOTE1 if &KEY2 is 1, to .MNOTE2 if &KEY2 is 2, to .MNOTE3 if &KEY2 is 3, or otherwise it falls through to the model statement at 114.
 N 
Statement 116 shows the extended AIF facility. This statement is written in the alternative format. The logical expressions are examined from left to right. Control passes to the sequence symbol corresponding to the first true expression encountered, or else falls through to the next model statement.
 O 
Statement 126 contains a subscripted created SET symbol in the name field. The created SET symbol has the form &(e), where e is an expression made up of character strings, variable symbols, or both. When the symbol is encountered during macro generation, the assembler evaluates the expression e. The operation code DEMO is used as a macro instruction in statement 136, and &KEY1 is given the value C. The e in this case is X&KEY1, which results in the value XC. Thus the name field in statement 121, &(x&key1)(2), becomes &XC(2). Statement 135 assigns the value C to &XC(1), and the value TRANSYLVANIA to &XC(2). The model statement (135) is generated at statement 151; the name field contains TRANSYLVANIA. The sequence field of statement 147 shows that this statement is a level 01 expansion of a macro, and the corresponding model statement is statement number 126.

You can use created SET symbols wherever regular SET symbols are used; for example: in declarations, name fields, operands of SET statements, model statements. Likewise, they are subject to all the restrictions of regular SET symbols.

 P 
In statements 133 and 134, &XA is declared as a subscripted global SETC variable with a subscript of 1 and in the next statement, which is an extended SET statement, we store the value MISSISSIPPI into &XA(2). The assembler allows up to 2,147,483,647 array values in a subscripted global SETC symbol.
 Q 
Statement 136 is the macro instruction DEMO. &P1 has the value WRITE. Therefore, the model statement at statement 102 becomes an inner macro instruction, WRITE, producing the code at statements 141-146. The sequence field of these statements contains 03-IHBRD, indicating that they are generated by a level 03 macro (DEMO is 01, WRITE is 02) named IHBRDWRS. It is an inner macro called by WRITE.
 R 
Statements 151 and 152 contain some ordinary symbols longer than 8 characters. The limit for ordinary symbols, operation codes (for programmer and library macros and operation codes defined through OPSYN), variable symbols, and sequence symbols, is 63 characters (including the & and . in the latter two instances).
BIGNAME  Insert Programmer Macro in Source Stream now                                                          Page    9
  Active Usings: a,R8
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                             154 **********************************************************************
                                             155 *  Copy 'NOTE' macro in from maclib, rename it 'MARK', call it under *
                                             156 *    its ALIAS -- in expansion of MARK, notice reference back to     *
                                             157 *      definition statements in 'columns' 76-80 of expansion         *
                                             158 **********************************************************************
                                         S   160          copy  note
                                             161=*%/*   START OF PL/X COMMENT ENDING ON %MACRO STATEMENT            @L2A 00010000
                                             162=         MACRO                                                          00020000
                                             163=&NAME    NOTE  &DCB,&TYPE=REL,&DECB=                               @L3C 00024400
                                             164=.* $MAC(NOTE):                                                          00028800 
                                             165=.*PROPRIETARY V3 STATEMENT                                              00031600 
                                             166=.*LICENSED MATERIALS - PROPERTY OF IBM                                  00034400 
                                             167=.*"RESTRICTED MATERIALS OF IBM"                                         00037200 
                                             168=.*5695-DF1                                                              00040000  
                                             169=.*COPYRIGHT 1994, 2011 IBM CORP.                                        00042800 
                                             170=.*END PROPRIETARY V3 STATEMENT                                          00045600 
                                             171=.* STATUS = z/OS 1.13 DFSMS                                        @L4C 00048700 
                                             172=.*                                                                      00051900 
                                             173=.* CHANGE ACTIVITY =                                                    00053000 
                                             174=.*                                                                      00054100 
                                             175=.* $H1=3480,JDP1111,,STLPKH:  3480 SUPPORT                            * 00054600 
                                             176=.* $L1=31BIT,JDZ1110,,SJPLRK:  INVOCABLE IN 31-BIT MODE            @L1A 00055100 
                                             177=.* $L2=PLX  ,JDZ1110,930930,SJPLMET: PL/X SUPPORT                  @L2A 00055600 
                                             178=.* $L3=NOTEDECB,HDZ11B0,940426,SJPLCC: SUPPORT DECB KEYWORD        @L3A 00056100 
                                             179=.* $L4=64BIT,JDZ1D10,20101116,SVLWER: 64 bit message               @L4A 00056600 
                                             180=.*                                                                      00057600 
                                             181=         GBLC  &SYSAM64    AMODE64=YES set by SYSSTATE macro       @L4A 00058000 
                                             182=         GBLC  &SYSASCE    ASCENV=AR or ANY set by SYSSTATE macro  @L4A 00058400 
                                             183=         SYSSTATE TEST     Test how macros are to expand           @L4A 00058800 
                                             184=         AIF   ('&SYSAM64' EQ 'YES').ERR3    GO IF AMODE64=YES     @L4A 00059200 
                                             185=         AIF   (('&SYSASCE' NE '') AND ('&SYSASCE' NE 'P')).ERR4   @L4A 00059600 
                                             186=         AIF   ('&DCB' EQ '').ERR                                       00060000 
                                             187=&NAME    IHBINNRA &DCB,&DECB                                       @L3C 00075000 
                                             188=         AIF   ('&TYPE' NE 'REL').NOTREL                           @H1A 00090000 
                                             189=         SLR   15,15               CLEAR REGISTER                  @L1A 00098300 
                                             190=         ICM   15,7,85(1)          NOTE ROUTINE ADDRESS            @L1C 00106600 
                                             191=         AIF   ('&DECB' NE '').DECBNT                              @L3A 00115000 
                                             192=         BASR  14,15               LINK TO NOTE ROUTINE            @L4C 00127500 
                                             193=         MEXIT                                                          00140000 
                                             194=.DECBNT  BAS   14,8(,15)           LINK TO NOTE RTN                @L3A 00140800 
                                             195=         MEXIT                                                     @L3A 00141600 
                                             196=.NOTREL  AIF   ('&TYPE' NE 'ABS').ERR1                             @H1A 00142500  
                                             197=         AIF   ('&DECB' NE '').ERR2                                @L3A 00143700  
                                             198=         SLR   0,0                 INDICATES NOTE MACRO            @H1A 00145900 
                                             199=         LA    15,32               ROUTER CODE                     @H1A 00148100 
                                             200=         SVC   109                 SUPERVISOR CALL                 @H1A 00150300 
                                             201=         MEXIT                                                     @H1A 00152500 
                                             202=.ERR1    MNOTE 8,'INVALID PARAMETER FOR TYPE'                      @H1A 00155000 
                                             203=         MEXIT                                                     @H1A 00157500 
                                             204=.ERR2    MNOTE 8,'DECB KEYWORD NOT VALID WITH TYPE=ABS'            @L3A 00158300 
                                             205=         MEXIT                                                     @L3A 00159100 
                                             206=.ERR     IHBERMAC 6                                                     00160000 
                                             207=         MEXIT                                                     @L4A 00163300 
                                             208=.ERR3    IGGERMAC 203,NOTE    THE NOTE MACRO DOES NOT SUPPORT      @L4A 00166600 
BIGNAME  Insert Programmer Macro in Source Stream now                                                          Page   10   
Active Usings: a,R8   Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                   HLASM R6.0  2015/02/21 20.03
                                             209=         MEXIT                  SYSSTATE AMODE64=YES               @L4A 00169900 
                                             210=.ERR4    IGGERMAC 204,NOTE    THE NOTE MACRO DOES NOT SUPPORT      @L4A 00173200 
                                             211=         MEXIT                  SYSSTATE ASCENV=AR OR ANY          @L4A 00176500 
                                             212=         MEND                                                           00180000 
                                             213=**/ NOTE: MACRO KEYS(1:1(DCB_NAME,DCB_ADDR),                   /*@L2A*/ 00230000 
                                             214=*                   0:1(CU_BLOCKID_NAME,CU_BLOCKID_ADDR),      /*@L2A*/ 00280000 
                                             215=*                   1:1(BLOCKID_NAME,BLOCKID_ADDR),            /*@L2A*/ 00330000 
                                             216=*                   0:1(BLOCKID_TYPE,ABS_BLOCK,REL_BLOCK),     /*@L2A*/ 00380000  
                                             217=*                       RETCODE,RSNCODE);                      /*@L2A*/ 00430000 
                                             218=* ANS('? '||MACLABEL||' NOTEP '||MACKEYS||';') RESCAN SKIP;    /*@L2A*/ 00480000 
                                             219=* %END NOTE;                                                   /*@L2A*/ 00530000 
                                         T   222 mark     opsyn note      Comments of generated statements occupy same  
                                             223          mark  (6)         'COLUMNS' as those in MODEL statements 
                                             226+*                                                                 1@L1D 
                                             227+*                                                                 1@L1D 
00000086 1816                                229+         LR    1,6                               LOAD PARAMETER REG 1   02-IHBINNRA
00000088 1FFF                                230+         SLR   15,15               CLEAR REGISTER                  @L1A 01-00000189 
0000008A BFF7 1055               00000055    231+         ICM   15,7,85(1)          NOTE ROUTINE ADDRESS            @L1C 01-00000190 
0000008E 0DEF                                232+         BASR  14,15               LINK TO NOTE ROUTINE            @L4C 01-00000192 
                                             234 ********************************************************************** 
000000B0                000000AC 000000F0    235 deecees  loctr        Switch to alternate location counter 
000000B0 0B0000B000000050                    236 b5       ccw   X'0b',b5,0,80 
 S 
Library macros can be inserted into the source stream as programmer macros by use of a COPY statement. The result (statements 161 to 219) is treated as a source-stream macro definition. When a library macro is brought in and expanded by use of a macro instruction, the assembler:
  1. Looks up the macro by its member-name.
  2. Verifies that this same name is used in the operation field of the prototype statement.
Therefore, for example, DCB has to be cataloged as DCB. However, as COPY code, the member name bears no relationship to any of the statements in the member. Thus, several variations of a given macro could be stored as a library under separate names, then copied in at various places in a single assembly as needed. (High Level Assembler allows you to define and redefine a macro any number of times).
 T 
In statement 222, MARK is made a synonym for NOTE. To identify the NOTE macro as a defined instruction mnemonic, it has to be used as either a system macro call (that is, from a macro library), or a programmer macro definition, before its use in the operand field of an OPSYN statement. The COPY code at statements 161 through 219 is a programmer macro definition. The macro instruction at statement 223 is MARK. You can use MARK and NOTE interchangeably. If required, you could remove NOTE as a macro definition in the following way:
MARK      OPSYN          NOTE
NOTE      OPSYN          ,

You could then refer to the macro only as MARK.

                                             238 ********************************************************************** 
                                             239 *  Display of &SYSTIME, &SYSDATE, &SYSPARM and &SYSLOC               * 
                                             240 ********************************************************************** 
                                             242          print nodata 
                                         U   243   dc  c'TIME = &systime, DATE = &sysdate, PARM = &sysparm' 
000000B8 E3C9D4C5407E40F2                       +  dc  c'TIME = 20.03, DATE = 02/21/15, PARM = thisisatestsysparm' 
                                             245          macro 
                                             246          locate 
                                         V   247 &sysect  csect      Display of current control section 
                                             248 &sysloc  loctr          and location counter 
                                             249          mend 
                                             251          locate 
000000F0                000000AC 000000F0    252+a        csect      Display of current control section                  01-00000247 
000000F0                000000AC 000000F0    253+deecees  loctr          and location counter                            01-00000248 
00000090                00000000 000000F0    254 a        loctr
 U 
Statement 243 demonstrates &SYSTIME, &SYSDATE, and &SYSPARM. The values for the first two are the same as in the heading line. The value for &SYSPARM is the value passed in the PARM field of the EXEC statement, or the default value assigned to &SYSPARM when High Level Assembler is installed.
 V 
System variable symbols &SYSLOC and &SYSECT are displayed at statements 252 and 253. The sequence field indicates that the model statements are statements 247 and 249.
BIGNAME  Ordinary, Labeled and Dependent USING Instructions                                                    Page   11
  Active Usings: a,R8
  Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                             256 **********************************************************************
00000000                00000000 00000814 W  257 pd2      com                  Named COMMON thrown in for good measure
00000000                                     258          ds    500f
000007D0 1867                                259          lr    6,7
                                             261 **********************************************************************
                                             262 *  Use of ordinary, labeled and dependent USING Instructions         *
                                          X  263 **********************************************************************
                    R:C 000007D2             265          using *,12
000007D2 4110 C022               000007F4    266          la    1,area1
000007D6 4120 C032               00000804    267          la    2,area2
                    R:1 00000000             268          using first,1                 Ordinary USING
                    R:2 00000000             269 lab      using first,2                 Labeled USING
                  1 008 00000000 00000008    270          using second,first2           Dependent USING
                  2 008 00000000 00000008    271 labdep   using third,lab.first2        Labeled dependent USING
000007DA D207 1000 8098 00000000 00000098    272          mvc   first1,=cl8'1st'        Uses ordinary USING
000007E0 D207 2000 8098 00000000 00000098    273          mvc   lab.first1,=cl8'1st'    Uses labeled USING
000007E6 D203 1008 80A0 00000000 000000A0    274          mvc   second1,=cl4'2nd'       Uses dependent USING
000007EC D201 2008 80A4 00000000 000000A4    275          mvc   labdep.third1,=cl2'3d'  Uses labeled dependent USING
000007F4                                     276 area1    ds    0f                      First data area
000007F4                                     277 area1a   ds    cl8
000007FC                                     278 area1b   ds    cl8
00000804                                     279 area2    ds    0f                      Second data area
00000804                                     280 area2a   ds    cl8
0000080C                                     281 area2b   ds    cl8
00000000                00000000 00000010    282 first    dsect                         First dsect
00000000                                     283 first1   ds    cl8
00000008                                     284 first2   ds    cl8
00000000                00000000 00000008    285 second   dsect                         Second dsect
00000000                                     286 second1  ds    cl4
00000004                                     287 second2  ds    cl4
00000000                00000000 000000EC    288 third    dsect                         Third dsect
00000000                                     289 third1   ds    cl2
00000002                                     290 third2   ds    cl2
 W 
Illustration of named COMMON. You can establish addressability for a named COMMON section with:
         USING          section-name,register

You can address data in a blank COMMON section by labeling a statement within the section after the COMMON statement.

 X 
In statement 268, an ordinary USING is established for AREA1 using the DSECT FIRST. When the fields within DSECT FIRST are referenced using symbols with the first qualifier, register 1 is used to resolve the address as in statement 231.

In statement 269, a labeled USING is established for AREA2 using the DSECT FIRST. Register 2 is used to resolve the address for qualified symbols within AREA2 when referred to using the qualifier second as in statement 273.

In statement 270, a dependent USING is established at the field FIRST2 using the DSECT SECOND. The corresponding ordinary USING for field FIRST2 is the USING on statement 268. It uses register 1 to resolve the address. The statement on line 274 specifies a field within DSECT SECOND and the assembler uses register 1 to resolve the address.

In statement 271, a labeled dependent USING is established at the field FIRST2 using the DSECT THIRD. The USING specifies the labeled USING LAB to resolve the address for field FIRST2. In statement 275, the labeled dependent USING is specified and register 2 is used to resolve the address of the field THIRD1.

BIGNAME  Predefined Absolute Symbols in SETA and SETC expressions                                              Page   12
  Active Usings: first,R1  second(X'FF8'),R1+X'8'  a,R8  pd2+X'7D2',R12  lab.first,R2  labdep.third(X'FF8'),R2+X'8'
D-Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                             292 **********************************************************************
                                             293 *  Use of predefined absolute symbols in SETA and SETC expressions   *
                                             294 **********************************************************************
                        00000064             296 hundred  equ   100
                                             297 &dividnd seta  20 
                                         Y   298 &percent seta  &dividnd*100/40         Predefined symbol in SETA 
                        00000032             299 fifty    equ   50 
                                         Z   300 &longwd  setc  (hundred)'a'            Predefined symbol in SETC 
                                             301          dc    c'&longwd' 
00000004 8181818181818181                       +         dc    c'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaX 
0000000C 8181818181818181                       +               aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' 
                                             302 &twowds  setc  (fifty)'a'.' '.(hundred/2)'B' 
                                             303          dc    c'&twowds' 
00000068 8181818181818181                       +         dc    c'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa BBBX 
00000070 8181818181818181                       +               BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'
 Y 
In statement 298, the SETA statement specifies a variable symbol (&DIVIDND) as well as other arithmetic terms.
 Z 
In statement 300 the SETC statement specifies a predefined absolute symbol (HUNDRED) as the duplication factor.
BIGNAME  Symbol Attribute Enhancements                                                                         Page   13
  Active Usings: first,R1  second(X'FF8'),R1+X'8'  a,R8  pd2+X'7D2',R12  lab.first,R2  labdep.third(X'FF8'),R2+X'8'
D-Loc    Object Code      Addr1    Addr2    Stmt  Source Statement                          HLASM R6.0  2015/02/21 20.03
                                             305 **********************************************************************
                                             306 *  Symbol Attribute enhancements                                     *
                                             307 **********************************************************************
000000CD C1C2C3                              309 SYMBOL1  DC    C'ABC'
000000D0 12345C                              310 SYMBOL2  DC    P'123.45'
                                             311 &VAR1    SETC  'SYMBOL1'
                                             312 &VAR2    SETC  'SYMBOL2' 
000000D3 00 
000000D4 4110 80A6               000000A6    313          LA    1,=C'ABC' 
000000D8 4110 80A9               000000A9    314          LA    1,=P'123.45' 
                                         1   316 &TYPE    SETC  T'=C'ABC'
                                             317          DC    CL1'&TYPE' 
000000DC C3                                     +         DC    CL1'C' 
000000DD C3                                  318          DC    AL1(T'SYMBOL1)
                                             319          DC    AL1(T'&VAR1) 
000000DE C3                                     +         DC    AL1(T'SYMBOL1) 
000000DF C3                                  320          DC    AL1(T'=C'ABC') 
                                         2   321 &LEN     SETA  L'=C'ABC' 
                                             322          DC    AL1(&LEN) 
000000E0 03                                     +         DC    AL1(3) 
000000E1 03                                  323          DC    AL1(L'SYMBOL1)
                                             324          DC    AL1(L'&VAR1) 
000000E2 03                                     +         DC    AL1(L'SYMBOL1) 
000000E3 03                                  325          DC    AL1(L'=C'ABC') 
                                         3   326 &INT     SETA  I'=P'123.45' 
                                             327          DC    AL1(&INT) 
000000E4 03                                     +         DC    AL1(3) 
000000E5 03                                  328          DC    AL1(I'SYMBOL2) 
                                             329          DC    AL1(I'&VAR2) 
000000E6 03                                     +         DC    AL1(I'SYMBOL2) 
000000E7 03                                  330          DC    AL1(I'=P'123.45')
                                             331 &SCALE   SETA  S'=P'123.45' 
                                             332          DC    AL1(&SCALE) 
000000E8 02                                     +         DC    AL1(2) 
000000E9 02                                  333          DC    AL1(S'SYMBOL2)
                                             334          DC    AL1(S'&VAR2) 
000000EA 02                                     +         DC    AL1(S'SYMBOL2) 
000000EB 02                                  335          DC    AL1(S'=P'123.45')
                                             336          end 
00000090 00000044FFFFFFE8                5   337                =a(a5,x) 
00000098 F1A2A34040404040                    338                =cl8'1st' 
000000A0 F2958440                            339                =cl4'2nd' 
000000A4 F384                                340                =cl2'3d' 
000000A6 C1C2C3                              341                =C'ABC' 
000000A9 12345C                              342                =P'123.45'
 1 
The Type attribute (T') is allowed for ordinary symbols, SET symbols, and literals, in both conditional assembly instructions and machine or assembler instructions. It is allowed in both open code and macro definitions.
 2 
The Length attribute (L') is allowed for ordinary symbols, SET symbols, and literals, in both conditional assembly instructions and machine or assembler instructions. It is allowed in both open code and macro definitions.
 3 
The Integer attribute (I') is allowed for ordinary symbols, SET symbols, and literals, in both conditional assembly instructions and machine or assembler instructions. It is allowed in both open code and macro definitions.
 4 
The Scaling attribute (S') is allowed for ordinary symbols, SET symbols, and literals, in both conditional assembly instructions and machine or assembler instructions. It is allowed in both open code and macro definitions.
 5 
If there are literals outstanding when the END statement is encountered, they are assigned to the LOCTR now in effect for the first control section in the assembly. This can put the literals at the end of the first control section. In this sample assembly, the first control section, A, has two LOCTRs: A and DEECEES. Because A is active (at statement 254), the literals are assembled there. You control placement of literal pools with the LTORG statement. X'FFFFFFE8' is used for the contents of A(X), statement 337. The symbol X was assigned the value (4*-6) by an EQU in statement 194.
BIGNAME                                          Relocation Dictionary                                         Page   14
   Pos.Id   Rel.Id   Address  Type  Action                                                  HLASM R6.0  2015/02/21 20.03
  00000004 00000004 00000090   A 4     +
  00000004 00000004 000000B1   A 3     +
BIGNAME                        Ordinary Symbol and Literal Cross Reference                                     Page   15
Symbol   Length   Value     Id    R Type Asm  Program   Defn References                     HLASM R6.0  2015/02/21 20.03
a             1 00000000 00000004     J                   28   62   252   254
area1         4 000007F4 00000009     F  F               276  266
area2         4 00000804 00000009     F  F               279  267
a5            2 00000044 00000004     I                   68   72   337
a8            2 000000B0 00000004     L                   72  152M
b5            8 000000B0 00000004     W                  236   72   152M  236
constant      4 000000AC 00000004     F  F                61   59   152M
deecees       1 000000AC 00000004     J                   60  235   253
first         1 00000000 FFFFFFFF     J                  282  268U  269U
first1        8 00000000 FFFFFFFF     C  C               283  272M  273M
first2        8 00000008 FFFFFFFF     C  C               284  270U  271
lab      ***QUALIFIER*** 00000009     U                  269  271U  273
labdep   ***QUALIFIER*** 00000009     U                  271  275
reallylongsymbol
              4 00000082 00000004     I                  152   45    52
second        1 00000000 FFFFFFFE     J                  285  270U
second1       4 00000000 FFFFFFFE     C  C               286  274M
SYMBOL1       3 000000CD FFFFFFFD     C  C               309  318   319   323   324
SYMBOL2       3 000000D0 FFFFFFFD     P  P               310  328   329   333   334
third         1 00000000 FFFFFFFD     J                  288  271U
third1        2 00000000 FFFFFFFD     C  C               289  275M
TRANSYLVANIA
              4 0000007E 00000004     I                  151   45    52
X             1 FFFFFFE8 00000004 A   U                   94  337
=a(a5,x)      4 00000090 00000004     A                  337  151
=C'ABC'       3 000000A6 00000004     C                  341  313   320   325
=cl2'3d'      2 000000A4 00000004     C                  340  275
=cl4'2nd'
              4 000000A0 00000004     C                  339  274
=cl8'1st'
              8 00000098 00000004     C                  338  272   273
=P'123.45'
              3 000000A9 00000004     P                  342  314   330   335
BIGNAME                           Unreferenced Symbols Defined in CSECTs                                       Page   16
  Defn  Symbol                                                                              HLASM R6.0  2015/02/21 20.03
    70  a7
   150  SUSQUEHANNA
BIGNAME                                   Macro and Copy Code Source Summary                                   Page   17
 Con Source                                        Volume    Members                        HLASM R6.0  2015/02/21 20.03
     PRIMARY INPUT                                           DEMO     LOCATE   NOTE
  L4 SYS1.MACLIB                                   37SY03    IHBINNRA IHBINNRR IHBRDWRS NOTE     SYSSTATE WRITE    WTO
BIGNAME                                         Dsect Cross Reference                                          Page   18
Dsect     Length      Id       Defn                                                         HLASM R6.0  2015/02/21 20.03
first    00000010  FFFFFFFF     282
second   00000008  FFFFFFFE     285
third    000000EC  FFFFFFFD     288
BIGNAME                                               Using Map                                                Page   19
                                                                                            HLASM R6.0  2015/02/21 20.03
  Stmt  -----Location----- Action ----------------Using----------------- Reg Max     Last Label and Using Text
          Count      Id           Type          Value    Range     Id        Disp    Stmt
    29  00000000  00000004 USING  ORDINARY    00000000 00001000 00000004   8 000AC    314 *,8
   265  000007D2  00000009 USING  ORDINARY    000007D2 00001000 00000009  12 00032    267 *,12
   268  000007DA  00000009 USING  ORDINARY    00000000 00001000 FFFFFFFF   1 00008    274 first,1
   269  000007DA  00000009 USING  LABELED     00000000 00001000 FFFFFFFF   2 00008    273 lab.first,2
   270  000007DA  00000009 USING  DEPENDENT  +00000008 00000FF8 FFFFFFFE   1              second,first2
   271  000007DA  00000009 USING  LAB+DEPND  +00000008 00000FF8 FFFFFFFD   2              labdep.third,lab.first2
                                   General Purpose Register Cross Reference                                    Page   20
 Register  References (M=modified, B=branch, U=USING, D=DROP, N=index)                      HLASM R6.0  2015/02/21 20.03
    0(0)    (no references identified)
    1(1)      68M   92M  141M  142   143N  229M  231   266M  268U  313M  314M
    2(2)      68   267M  269U
    3(3)     152N
    4(4)    (no references identified)
    5(5)      59M  149M
    6(6)     141   229   259M
    7(7)     152   259
    8(8)      29U  143   145
    9(9)     150M
   10(A)     149   150
   11(B)    (no references identified)
   12(C)     151M  265U
   13(D)      92   151M
   14(E)      31B  146M  232M
   15(F)      30M   30   144M  144   145M  146B  230M  230   231M  232B
BIGNAME                           Diagnostic Cross Reference and Assembler Summary                             Page   21
                                                                                            HLASM R6.0  2015/02/21 20.03
     No Statements Flagged in this Assembly
HIGH LEVEL ASSEMBLER, 5696-234, RELEASE 6.0, PTF R160
SYSTEM: z/OS 02.01.00              JOBNAME: SAMP0S      STEPNAME: C          PROCSTEP: (NOPROC)
Data Sets Allocated for this Assembly
 Con DDname   Data Set Name                                Volume  Member
  A1 ASMAOPT  SMORSA.SAMP0S.JOB47772.D0000101.?
  P1 SYSIN    SMORSA.BOOK.SAMPLE.ASM                       37P003  ASMASAMP
  L1 SYSLIB   SMORSA.BOOK.SAMPLE.MACS                      37P004
  L2          SMORSA.BOOK.SAMPLE.COPY                      37P002
  L3          ANTZ.HLASM.V160.SPA160.AASMMAC2              37P001
  L4          SYS1.MACLIB                                  37SY03
     SYSPRINT SMORSA.SAMP0S.JOB47772.D0000102.?

  64708K allocated to Buffer Pool       Storage required     544K
    245 Primary Input Records Read         4232 Library Records Read                  0 Work File Reads
      3 ASMAOPT Records Read                534 Primary Print Records Written         0 Work File Writes
      1 Object Records Written                0 ADATA Records Written
Assembly Start Time: 20.03.49 Stop Time: 20.03.49 Processor Time: 00.00.00.0112
Return Code 000