Appendix E. 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 the descriptions below 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                                   Page    1
                                                                                            HLASM R6.0  2008/07/11 17.48
  No Overriding ASMAOPT Parameters
  No Overriding Parameters
  No Process Statements


  Options for this Assembly
  NOADATA
    ALIGN
  NOASA
    BATCH
    CODEPAGE(047C)
  NOCOMPAT
  NODBCS
  NODECK
    DXREF
    ESD
  NOEXIT
    FLAG(0,ALIGN,CONT,EXLITW,NOIMPLEN,NOPAGE0,PUSH,RECORD,NOSUBSTR,USING0)
  NOFOLD
  NOGOFF
  NOINFO
    LANGUAGE(EN)
  NOLIBMAC
    LINECOUNT(60)
    LIST(121)
    MACHINE(,NOLIST)
    MXREF(SOURCE)
    OBJECT
    OPTABLE(UNI,NOLIST)
  NOPCONTROL
  NOPESTOP
  NOPROFILE
  NORA2
  NORENT
    RLD
    RXREF
    SECTALGN(8)
    SIZE(MAX)
  NOSUPRWARN
    SYSPARM()
  NOTERM
  NOTEST
    THREAD
  NOTRANSLATE
    TYPECHECK(MAGNITUDE,REGISTER)
    USING(NOLIMIT,MAP,WARN(15))
    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  2008/07/11 17.48
A         SD 00000001 00000000 000000DE             00
PD2       CM 00000002 00000000 00000814             00    A 

BIGNAME  Sample program.  1ST TITLE statement has no name, 2ND one does                                        Page    3
  Active Usings: None
  Loc  Object Code    Addr1 Addr2  Stmt   Source Statement                                  HLASM R6.0  2008/07/11 17.48
                                      2 **************************************************************          00002000
                                      3 *   Licensed Materials - Property of IBM                     *          00003000
                                      4 *                                                            *          00004000
                                      5 *   5696-234   5647-A01                                      *          00005000
                                      6 *                                                            *          00006000
                                      7 *   (C) Copyright IBM Corp. 1992, 2000. All Rights Reserved. *          00007000
                                      8 *                                                            *          00008000
                                      9 *   US Government Users Restricted Rights - Use,             *          00009000
                                     10 *   duplication or disclosure restricted by GSA ADP          *          00010000
                                     11 *   Schedule Contract with IBM Corp.                         *          00011000
                                     12 *                                                            *          00012000
                                     13 **************************************************************          00013000
                                     14 *********************************************************************   00014000
                                     15 * DISCLAIMER OF WARRANTIES                                          *   00015000
                                     16 *  The following enclosed code is sample code created by IBM        *   00016000
                                     17 *  Corporation. This sample code is licensed under the terms of     *   00017000
                                     18 *  the High Level Assembler license, but is not part of any         *   00018000
                                     19 *  standard IBM product.  It is provided to you solely for the      *   00019000
                                     20 *  purpose of demonstrating the usage of some of the features of    *   00020000
                                     21 *  High Level Assembler.  The code is not supported by IBM and      *   00021000
                                     22 *  is provided on an "AS IS" basis, without warranty of any kind.   *   00022000
                                     23 *  IBM shall not be liable for any damages arising out of your      *   00023000
                                     24 *  use of the sample code, even if IBM has been advised of the      *   00024000
                                     25 *  possibility of such damages.                                     *   00025000
                                     26 *********************************************************************   00026000
000000                00000 000DE    27 a        csect                                                          00027000
                 R:8  00000          28          using *,8                                                      00028000
000000 1BFF                          29          sr    15,15      Set return code to zero                       00029000
000002 07FE                          30          br    14          and return.                                  00030000
                                     32 **********************************************************************  00032000
                                     33 *              PUSH  and POP  statements                             *  00033000
                                     34 * Push down the PRINT statement, replace it, retrieve original       *  00034000
                                     35 **********************************************************************  00035000
                                     37          push  print     Save Default setting '  PRINT ON,NODATA,GEN'   00037000
                                  B    38          print nogen,data                                               00038000
000004 0A23                          39          wto   mf=(E,(1))                    Expansion not shown        00039000

 A 
The external symbol dictionary shows a named common statement. The named common section is defined in statement 216.
 B 
Statement 37: Save the current status of the PRINT statement.

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

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

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

Statement 43: Restore earlier status of PRINT.

Statement 45: 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 46: The generated output of the macro WTO is shown, but only two bytes of data are shown.

000006 01230ABC0102030A           C    42  dc x'123,ABC',(reallylongsymbol-transylvania)b'1,10,11,1010,1011,1100' 00040000
00000E 0B0C0102030A0B0C
000016 0102030A0B0C0102
00001E 030A0B0C
                                     43          pop   print                   Restore default PRINT setting    00041000
                                     44          wto   mf=(E,(1))                    Expansion shown            00042000
000022 0A23                          46+         SVC   35                       ISSUE SVC 35               @L2C 01-WTO
000024 01230ABC0102030A              47  dc x'123,ABC',(reallylongsymbol-transylvania)b'1,10,11,1010,1011,1100' 00043000
                                     49 **********************************************************************  00045000
                                     50 *                     LOCTR  instruction                             *  00046000
                                     51 * LOCTR allows 'REMOTE' assembly of constant                         *  00047000
                                     52 **********************************************************************  00048000
000040 5850 80AC            000AC    54          l     5,constant                                               00050000
0000AC                000AC 000DE   D  55 deecees  loctr                                                          00051000
0000AC 00000005                      56 constant dc    f'5'      Constant coded here, assembled behind LOCTR A  00052000
BIGNAME  Sample program.  1ST TITLE statement has no name, 2ND one does                                        Page    4
  Active Usings: a,R8
  Loc  Object Code    Addr1 Addr2  Stmt   Source Statement                                  HLASM R6.0  2008/07/11 17.48
000044                00000 000DE    57 a        loctr                Return to 1st LOCTR in CSECT A            00053000
                                     59 **********************************************************************  00055000
                                     60 *  3 operand EQUATE with forward reference in 1ST operand            *  00056000
                                     61 **********************************************************************  00057000
000044 1812                          63 a5       lr    1,2            L'A5 = 2, T'A5 = I                        00059000
                                     64          print data                                                     00060000
000046 0000
000048 413243F6A8885A30              65 a7 dc l'3.1415926535897932384626433832795028841972' L'A7 = 16,T'A7 = L  00061000
000050 338D313198A2E037
                                     66 &type    setc  t'a7                                                     00062000
                                  E    67 a8       equ   b5,l'a5,c'&type'                                         00063000
                      000B0 00002      +a8       equ   b5,l'a5,c'L'                                             00063000

 C 
Statements 42 and 47: 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 144 and 145.
 D 
Statements 55, 57, 194, 212 and 213 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 of 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 27, 57, and 213. The location counter value shown each time is the continued value of the LOCTR. On the other hand, 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 56) is in LOCTR DEECEES but the instruction referring to it (statement 54) 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 67 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    5
  Active Usings: a,R8
  Loc  Object Code    Addr1 Addr2  Stmt   Source Statement                                  HLASM R6.0  2008/07/11 17.48
                                     69 **********************************************************************  00065000
                                     70 * Implicit declaration of locals &A, &C -- Use of SETC dup factor to *  00066000
                                     71 *   produce SETC string longer than 8, MNOTE in open code            *  00067000
                                     72 **********************************************************************  00068000
                                     74 &la8     seta  l'a8                                                     00070000
                                  F    75 &ta8     setc  t'a8                                                     00071000
                                     76          mnote *,'Length of A8 = &LA8, Type of A8 = &TA8'               00072000
                                  G      +*,Length of A8 = 2, Type of A8 = L                                      00072000
                                     78 &a       seta  2                                                        00074000
                                     79 &c       setc  (&a+3)'STRING,'                                          00075000
                                  H    80          mnote *,'&&C has value = &c'                                   00076000
                                       +*,&C has value = STRING,STRING,STRING,STRING,STRING,                    00076000
                                     82 **********************************************************************  00078000
                                  I    83 * Examples of 4 byte self-defined terms, unary + and -               *  00079000
                                     84 **********************************************************************  00080000
000058 7FFFFFFFC1C2C3C4              86          dc    a(2147483647,C'ABCD',X'ffffffff')                        00082000
000060 FFFFFFFF
000064 181D                          87          lr    -1+2,16+-3                                               00083000
                     FFFFE8          89 X        equ   4*-6                                                     00085000

 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 86 through 89 show 4-byte self-defining values and unary + and -. The value of X appears later in a literal address constant (see statement 296).

BIGNAME  Insert Programmer Macro in Source Stream now                                                          Page    6
  Active Usings: a,R8
  Loc  Object Code    Addr1 Addr2  Stmt   Source Statement                                  HLASM R6.0  2008/07/11 17.48
                                     91 **********************************************************************  00087000
                                     92 *  Mixed keywords and positional parameters, extended AGO and AIF    *  00088000
                                     93 *     statements, declaration and use of subscripted SET symbols,    *  00089000
                                     94 *       Use of created SET symbols, extended SET statements          *  00090000
                                     95 **********************************************************************  00091000
                                  J    97          macro                                                          00093000
                                     98          demo  &p1,&key1=A,&p2,&key2=1,&p3,&key3=3,&p4                  00094000
                                  K    99 &loc(1)  setc  '2','3'        &LOC is dimensioned LCLC by default       00095000
                                    100          gblc  &xa(5),&xb(20),&xc(1)                                    00096000
                                    101          aif   ('&system_id'(1,3) eq 'VSE').vse                         00097000
                                  L   102          &p1   &syslist(4),&syslist(5),&syslist(6),mf=E                 00098000
                                    103          ago   .notvse                                                  00099000
                                    104 .vse     anop                 Use VSE WRITE macro parameters            00100000
                                    105          &p1   &syslist(4),SQ,&syslist(6)                               00101000
                                    106 .notvse  anop                                                           00102000
                                    107 &n       seta  1                                                        00103000
                                  M   108          ago   (&key2).mnote1,.mnote2,.mnote3                           0010400
                                    109 &n       seta  2                                                        00105000
                                    110          mnote *,'&&KEY2 not 1,2, or 3---Use &&KEY3 in place of it'     00106000
                                  N   111          aif   (&key3 eq 1).mnote1,                                    X00107000
                                                       (&key3 eq 2).mnote2,(&key3 eq 3).mnote3                    00108000
                                    112          mnote *,'Both &&KEY2 and &&KEY3 fail to qualify'               00109000
                                    113          ago   .common                                                  00110000
                                    114 .mnote1  mnote *,'&&KEY&LOC(&N) = 1'                                    00111000
                                    115          ago   .common                                                  00112000
                                    116 .mnote2  mnote *,'&&KEY&LOC(&N) = 2'                                    00113000
                                    117          ago   .common                                                  00114000
                                    118 .mnote3  mnote *,'&&KEY&LOC(&N) = 3'                                    00115000
                                    119 .common  l     5,8(,10)       Note that opcodes, operands & comments    00116000
                                    120 &xb(2) sr 9,10                  on MODEL statements                     00117000
                                  O   121 &(x&key1)(2) lm 12,13,=a(a5,x)    are kept in place unless displaced    00118000
                                    122 &p2 st 7,&p3                        as a result of substitution         00119000
                                    123          mend                                                           00120000
                                    125 *****          DEMO  MACRO  instruction (call)                          00122000
                                  P   127          gblc  &xa(1),&xb(2),&xc(3)                                     00124000
                                    128 &xa(1)   setc  'A','MISSISSIPPI'                                        00125000
                                    129 &xb(1)   setc  'B','SUSQUEHANNA'                                        00126000
                                    130 &xc(1)   setc  'C','TRANSYLVANIA'                                       00127000
                                  Q   131          demo  key3=2,write,reallylongsymbol,                           M00128000
                                                       a8+8*(b5-constant-7)(3),key1=C,(6),SF,                   N00129000
                                                       (8),key2=7                                               00130000
000066 1816                         134+         LR    1,6                               LOAD DECB ADDRESS      03-IHBRD
000068 9220 1005      00005         135+         MVI   5(1),X'20'               SET TYPE FIELD                  03-IHBRD
00006C 5081 0008            00008   136+         ST    8,8(1,0)                          STORE DCB ADDRESS      03-IHBRD
000070 58F1 0008            00008   137+         L     15,8(1,0)           LOAD DCB ADDRESS                     03-IHBRD
000074 58F0 F030            00030   138+         L     15,48(0,15)                       LOAD RDWR ROUTINE ADDR 03-IHBRD
000078 05EF                         139+         BALR  14,15                             LINK TO RDWR ROUTINE   03-IHBRD
                                    140+*,&KEY2 not 1,2, or 3---Use &KEY3 in place of it                        01-00110
                                    141+*,&KEY3 = 2                                                             01-00116
00007A 5850 A008            00008   142+         l     5,8(,10)       Note that opcodes, operands & comments    01-00119
00007E 1B9A                       R   143+SUSQUEHANNA sr 9,10             on MODEL statements                     01-00120
000080 98CD 8090            00090   144+TRANSYLVANIA lm 12,13,=a(a5,x)    are kept in place unless displaced    01-00121
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  2008/07/11 17.48
000084 5073 8098            00098   145+reallylongsymbol st 7,a8+8*(b5-constant-7)(3)                             X01-00122
                                       +                                    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 may 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 99 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 102 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's treated as a macro, it is still expanded as a machine or assembler operation.
 M 
Statement 108 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 109.
 N 
Statement 111 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 121 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 131, 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 130 assigns the value C to &XC(1), and the value TRANSYLVANIA to &XC(2). The model statement (121) is generated at statement 144; the name field contains TRANSYLVANIA. The sequence field of statement 144, shows that this statement is a level 01 expansion of a macro, and the corresponding model statement is statement number 121.

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 127 and 128, &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 131 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 134-139. 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 144 and 145 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, respectively).

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  2008/07/11 17.48
                                    147 **********************************************************************  00132000
                                    148 *  Copy 'NOTE' macro in from maclib, rename it 'MARK', call it under *  00133000
                                    149 *    its ALIAS -- in expansion of MARK, notice reference back to     *  00134000
                                    150 *      definition statements in 'columns' 76-80 of expansion         *  00135000
                                    151 **********************************************************************  00136000
                                  S   153          copy  note                                                   00138000
                                    154=         MACRO                                                          00010000
                                    155=&NAME    NOTE  &DCB,&DUMMY=,&TYPE=REL                                   00020000
                                    156=.* $MAC(NOTE):                                                          00030000
                                    157=.*  5665-XA2                                                            00032000
                                    158=.*  CONTAINS RESTRICTED MATERIALS OF IBM                                00034000
                                    159=.*  (C) COPYRIGHT IBM CORP. 1984                                        00036000
                                    160=.*  LICENSED MATERIALS - PROPERTY OF IBM                                00038000
                                    161=.*  REFER TO COPYRIGHT INSTRUCTIONS                                     00040000
                                    162=.*  FORM NUMBER G120-2083.                                              00042000
                                    163=.* STATUS =  MVS/XA  DFP RELEASE 1.2                              @H1   00044000
                                    164=.*                                                                      00046990
                                    165=.* CHANGE ACTIVITY =                                                    00120000
                                    166=.*                                                                      00130000
                                    167=.* $H1=3480,JDP1111,,STLPKH:  3480 SUPPORT                           *  00140000
                                    168=.*                                                                      00150000
                                    169=         AIF   ('&DCB' EQ '').ERR                                       00160000
                                    170=&NAME    IHBINNRA &DCB                                                  00170000
                                    171=         AIF   ('&TYPE' NE 'REL').NOTREL                           @H1A 00180000
                                    172=         L     15,84(0,1)                        LOAD NOTE  RTN ADDRESS 00190000
                                    173=         BALR  14,15                             LINK TO NOTE  ROUTINE  00200000
                                    174=         MEXIT                                                          00210000
                                    175=.NOTREL  AIF   ('&TYPE' NE 'ABS').ERR1                             @H1A 00220000
                                    176=         SLR   0,0                      INDICATES NOTE MACRO       @H1A 00230000
                                    177=         LA    15,32                    ROUTER CODE                @H1A 00240000
                                    178=         SVC   109                      SUPERVISOR CALL            @H1A 00250000
                                    179=         MEXIT                                                     @H1A 00260000
                                    180=.ERR1    MNOTE 8,'INVALID PARAMETER FOR TYPE'                 @H1A      00270000
                                    181=         MEXIT                                                     @H1A 00280000
                                    182=.ERR     IHBERMAC 6                                                     00290000
                                    183=         MEND                                                           00300000
                                  T   186 mark     opsyn note      Comments of generated statements occupy same   00141000
                                    187          mark  (6)         'COLUMNS' as those in MODEL statements       00142000
000088 1816                         189+         LR    1,6                               LOAD PARAMETER REG 1   02-IHBIN
00008A 58F0 1054            00054   190+         L     15,84(0,1)                        LOAD NOTE  RTN ADDRESS 01-00172
00008E 05EF                         191+         BALR  14,15                             LINK TO NOTE  ROUTINE  01-00173
                                    193 **********************************************************************  00144000
0000B0                000AC 000DE   194 deecees  loctr        Switch to alternate location counter              00145000
0000B0 0B0000B000000050             195 b5       ccw   X'0b',b5,0,80                                            00146000
                                    197 **********************************************************************  00148000
                                    198 *  Display of &SYSTIME, &SYSDATE, &SYSPARM and &SYSLOC               *  00149000
                                    199 **********************************************************************  00150000
                                    201          print nodata                                                   00152000
                                  U   202   dc  c'TIME = &systime, DATE = &sysdate, PARM = &sysparm'              00153000
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  2008/07/11 17.48
0000B8 E3C9D4C5407E40F1                +  dc  c'TIME = 17.22, DATE = 06/09/04, PARM = '                         00153000
                                    204          macro                                                          00155000
                                    205          locate                                                         00156000
                                  V   206 &sysect  csect      Display of current control section                  00157000
                                    207 &sysloc  loctr          and location counter                            00158000
                                    208          mend                                                           00159000
                                    210          locate                                                         00161000
0000DE                000AC 000DE   211+a        csect      Display of current control section                  01-00206
0000DE                000AC 000DE   212+deecees  loctr          and location counter                            01-00207
000090                00000 000DE   213 a        loctr                                                          00162000

 S 
Library macros can be inserted into the source stream as programmer macros by use of a COPY statement. The result (statements 154 to 183) 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 the macro up by its member-name and (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 186, 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 154 through 183 is a programmer macro definition. The macro instruction at statement 187 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.

 U 
Statement 202 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 211 and 212. The sequence field indicates that the model statements are statements 206 and 207.

BIGNAME  Ordinary, Labeled and Dependent USING Instructions                                                    Page   10
  Active Usings: a,R8
  Loc  Object Code    Addr1 Addr2  Stmt   Source Statement                                  HLASM R6.0  2008/07/11 17.48
                                    215 **********************************************************************  00164000
000000                00000 00814  W  216 pd2      com                  Named COMMON thrown in for good measure   00165000
000000                              217          ds    500f                                                     00166000
0007D0 1867                         218          lr    6,7                                                      00167000
                                    220 **********************************************************************  00169000
                                    221 *  Use of ordinary, labeled and dependent USING Instructions         *  00170000
                                  X   222 **********************************************************************  00171000
                 R:C  007D2         224          using *,12                                                     00173000
0007D2 4110 C022            007F4   225          la    1,area1                                                  00174000
0007D6 4120 C032            00804   226          la    2,area2                                                  00175000
                 R:1  00000         227          using first,1                 Ordinary USING                   00176000
                 R:2  00000         228 lab      using first,2                 Labeled USING                    00177000
               1 008  00000 00008   229          using second,first2           Dependent USING                  00178000
               2 008  00000 00008   230 labdep   using third,lab.first2        Labeled dependent USING          00179000
0007DA D207 1000 8098 00000 00098   231          mvc   first1,=cl8'1st'        Uses ordinary USING              00180000
0007E0 D207 2000 8098 00000 00098   232          mvc   lab.first1,=cl8'1st'    Uses labeled USING               00181000
0007E6 D203 1008 80A0 00000 000A0   233          mvc   second1,=cl4'2nd'       Uses dependent USING             00182000
0007EC D201 2008 80A4 00000 000A4   234          mvc   labdep.third1,=cl2'3d'  Uses labeled dependent USING     00183000
0007F4                              235 area1    ds    0f                      First data area                  00184000
0007F4                              236 area1a   ds    cl8                                                      00185000
0007FC                              237 area1b   ds    cl8                                                      00186000
000804                              238 area2    ds    0f                      Second data area                 00187000
000804                              239 area2a   ds    cl8                                                      00188000
00080C                              240 area2b   ds    cl8                                                      00189000
000000                00000 00010   241 first    dsect                         First dsect                      00190000
000000                              242 first1   ds    cl8                                                      00191000
000008                              243 first2   ds    cl8                                                      00192000
000000                00000 00008   244 second   dsect                         Second dsect                     00193000
000000                              245 second1  ds    cl4                                                      00194000
000004                              246 second2  ds    cl4                                                      00195000
000000                00000 000EC   247 third    dsect                         Third dsect                      00196000
000000                              248 third1   ds    cl2                                                      00197000
000002                              249 third2   ds    cl2                                                      00198000

 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 227, 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 228, 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 232.

In statement 229, 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 227. It uses register 1 to resolve the address. The statement on line 233 specifies a field within DSECT SECOND and the assembler uses register 1 to resolve the address.

In statement 230, 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 234, 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   11
  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  2008/07/11 17.48
                                    251 **********************************************************************  00200000
                                    252 *  Use of predefined absolute symbols in SETA and SETC expressions   *  00201000
                                    253 **********************************************************************  00202000
                      00064         255 hundred  equ   100                                                      00204000
                                    256 &dividnd seta  20                                                       00205000
                                  Y   257 &percent seta  &dividnd*100/40         Predefined symbol in SETA        00206000
                      00032         258 fifty    equ   50                                                       00207000
                                  Z   259 &longwd  setc  (hundred)'a'            Predefined symbol in SETC        00208000
                                    260          dc    c'&longwd'                                               00209000
000004 8181818181818181                +         dc    c'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaX00209000
00000C 8181818181818181                +               aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
                                    261 &twowds  setc  (fifty)'a'.' '.(hundred/2)'B'                            00210000
                                    262          dc    c'&twowds'                                               00211000
000068 8181818181818181                +         dc    c'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa BBBX00211000
000070 8181818181818181                +               BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB'

 Y 
In statement 257, the SETA statement specifies a variable symbol (&DIVIDND) as well as other arithmetic terms.
 Z 
In statement 259 the SETC statement specifies a predefined absolute symbol (HUNDRED) as the duplication factor.

BIGNAME  Symbol Attribute Enhancements                                                                         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  2008/07/11 17.48
                                    264 **********************************************************************  00213000
                                    265 *  Symbol Attribute enhancements                                     *  00214000
                                    266 **********************************************************************  00215000
0000CD C1C2C3                       268 SYMBOL1  DC    C'ABC'                                                   00217000
0000D0 12345C                       269 SYMBOL2  DC    P'123.45'                                                00218000
                                    270 &VAR1    SETC  'SYMBOL1'                                                00219000
                                    271 &VAR2    SETC  'SYMBOL2'                                                00220000
0000D3 00
0000D4 4110 80A6            000A6   272          LA    1,=C'ABC'                                                00221000
0000D8 4110 80A9            000A9   273          LA    1,=P'123.45'                                             00222000
                                1   275 &TYPE    SETC  T'=C'ABC'                                                00224000
                                    276          DC    CL1'&TYPE'                                               00225000
0000DC C3                              +         DC    CL1'C'                                                   00225000
0000DD C3                           277          DC    AL1(T'SYMBOL1)                                           00226000
                                    278          DC    AL1(T'&VAR1)                                             00227000
0000DE C3                              +         DC    AL1(T'SYMBOL1)                                           00227000
0000DF C3                           279          DC    AL1(T'=C'ABC')                                           00228000
                                2   280 &LEN     SETA  L'=C'ABC'                                                00229000
                                    281          DC    AL1(&LEN)                                                00230000
0000E0 03                              +         DC    AL1(3)                                                   00230000
0000E1 03                           282          DC    AL1(L'SYMBOL1)                                           00231000
                                    283          DC    AL1(L'&VAR1)                                             00232000
0000E2 03                              +         DC    AL1(L'SYMBOL1)                                           00232000
0000E3 03                           284          DC    AL1(L'=C'ABC')                                           00233000
                                3   285 &INT     SETA  I'=P'123.45'                                             00234000
                                    286          DC    AL1(&INT)                                                00235000
0000E4 03                              +         DC    AL1(3)                                                   00235000
0000E5 03                           287          DC    AL1(I'SYMBOL2)                                           00236000
                                    288          DC    AL1(I'&VAR2)                                             00237000
0000E6 03                              +         DC    AL1(I'SYMBOL2)                                           00237000
0000E7 03                           289          DC    AL1(I'=P'123.45')                                        00238000
                                4   290 &SCALE   SETA  S'=P'123.45'                                             00239000
                                    291          DC    AL1(&SCALE)                                              00240000
0000E8 02                              +         DC    AL1(2)                                                   00240000
0000E9 02                           292          DC    AL1(S'SYMBOL2)                                           00241000
                                    293          DC    AL1(S'&VAR2)                                             00242000
0000EA 02                              +         DC    AL1(S'SYMBOL2)                                           00242000
0000EB 02                           294          DC    AL1(S'=P'123.45')                                        00243000
                                    295          end                                                            00244000
000090 00000044FFFFFFE8         5   296                =a(a5,x)
000098 F1A2A34040404040             297                =cl8'1st'
0000A0 F2958440                     298                =cl4'2nd'
0000A4 F384                         299                =cl2'3d'
0000A6 C1C2C3                       300                =C'ABC'
0000A9 12345C                       301                =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 may or may not 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 213), the literals are assembled there. You control placement of literal pools by means of the LTORG statement. Note that X'FFFFFFE8' is used for the contents of A(X), statement 296. The symbol X was assigned the value (4*-6) by an EQU in statement 89.

BIGNAME                                          Relocation Dictionary                                         Page   13
   Pos.Id   Rel.Id   Address  Type  Action                                                  HLASM R6.0  2008/07/11 17.48
  00000001 00000001 00000090   A 4     +
  00000001 00000001 000000B1   A 3     +

BIGNAME                        Ordinary Symbol and Literal Cross Reference                                     Page   14
Symbol   Length   Value     Id    R Type Asm  Program   Defn References                     HLASM R6.0  2008/07/11 17.48
a             1 00000000 00000001     J                   27   57   211   213
area1         4 000007F4 00000002     F  F               235  225
area2         4 00000804 00000002     F  F               238  226
a5            2 00000044 00000001     I                   63   67   296
a8            2 000000B0 00000001     L                   67  145M
b5            8 000000B0 00000001     W                  195   67   145M  195
constant      4 000000AC 00000001     F  F                56   54   145M
deecees       1 000000AC 00000001     J                   55  194   212
first         1 00000000 FFFFFFFF     J                  241  227U  228U
first1        8 00000000 FFFFFFFF     C  C               242  231M  232M
first2        8 00000008 FFFFFFFF     C  C               243  229U  230
lab                      00000002 A   U                  228  230U  232
labdep                   00000002 A   U                  230  234
reallylongsymbol
              4 00000084 00000001     I                  145   42    47
second        1 00000000 FFFFFFFE     J                  244  229U
second1       4 00000000 FFFFFFFE     C  C               245  233M
SYMBOL1       3 000000CD FFFFFFFD     C  C               268  277   278   282   283
SYMBOL2       3 000000D0 FFFFFFFD     P  P               269  287   288   292   293
third         1 00000000 FFFFFFFD     J                  247  230U
third1        2 00000000 FFFFFFFD     C  C               248  234M
TRANSYLVANIA
              4 00000080 00000001     I                  144   42    47
X             1 FFFFFFE8 00000001 A   U                   89  296
=a(a5,x)      4 00000090 00000001     A                  296  144
=C'ABC'       3 000000A6 00000001     C                  300  272   279   284
=cl2'3d'      2 000000A4 00000001     C                  299  234
=cl4'2nd'
              4 000000A0 00000001     C                  298  233
=cl8'1st'
              8 00000098 00000001     C                  297  231   232
=P'123.45'
              3 000000A9 00000001     P                  301  273   289   294

BIGNAME                           Unreferenced Symbols Defined in CSECTs                                       Page   15
  Defn  Symbol                                                                              HLASM R6.0  2008/07/11 17.48
    65  a7
   143  SUSQUEHANNA

BIGNAME                                   Macro and Copy Code Source Summary                                   Page   16
 Con Source                                        Volume    Members                        HLASM R6.0  2008/07/11 17.48
     PRIMARY INPUT                                           DEMO     LOCATE   NOTE
  L2 OSMACRO  MACLIB   S2                          MNT190    IHBINNRA IHBRDWRS NOTE     WRITE    WTO

BIGNAME                                         Dsect Cross Reference                                          Page   17
Dsect     Length      Id       Defn                                                         HLASM R6.0  2008/07/11 17.48
first    00000010  FFFFFFFF     241
second   00000008  FFFFFFFE     244
third    000000EC  FFFFFFFD     247

BIGNAME                                               Using Map                                                Page   18
                                                                                            HLASM R6.0  2008/07/11 17.48
  Stmt  -----Location----- Action ----------------Using----------------- Reg Max     Last Label and Using Text
          Count      Id           Type          Value    Range     Id        Disp    Stmt
    28  00000000  00000001 USING  ORDINARY    00000000 00001000 00000001   8 000AC    273 *,8
   224  000007D2  00000002 USING  ORDINARY    000007D2 00001000 00000002  12 00032    226 *,12
   227  000007DA  00000002 USING  ORDINARY    00000000 00001000 FFFFFFFF   1 00008    233 first,1
   228  000007DA  00000002 USING  LABELED     00000000 00001000 FFFFFFFF   2 00008    232 lab.first,2
   229  000007DA  00000002 USING  DEPENDENT  +00000008 00000FF8 FFFFFFFE   1              second,first2
   230  000007DA  00000002 USING  LAB+DEPND  +00000008 00000FF8 FFFFFFFD   2              labdep.third,lab.first2

                                   General Purpose Register Cross Reference                                    Page   19
 Register  References (M=modified, B=branch, U=USING, D=DROP, N=index)                      HLASM R6.0  2008/07/11 17.48
    0(0)    (no references identified)
    1(1)      63M   87M  134M  135   136N  137N  189M  190   225M  227U  272M  273M
    2(2)      63   226M  228U
    3(3)     145N
    4(4)    (no references identified)
    5(5)      54M  142M
    6(6)     134   189   218M
    7(7)     145   218
    8(8)      28U  136
    9(9)     143M
   10(A)     142   143
   11(B)    (no references identified)
   12(C)     144M  224U
   13(D)      87   144M
   14(E)      30B  139M  191M
   15(F)      29M   29   137M  138M  138   139B  190M  191B

BIGNAME                           Diagnostic Cross Reference and Assembler Summary                             Page   20
                                                                                            HLASM R6.0  2008/07/11 17.48
     No Statements Flagged in this Assembly
HIGH LEVEL ASSEMBLER, 5696-234, RELEASE 5.0
SYSTEM: CMS 15                     JOBNAME: (NOJOB)     STEPNAME: (NOSTEP)   PROCSTEP: (NOPROC)
Data Sets Allocated for this Assembly
 Con DDname   Data Set Name                                Volume  Member
  P1 SYSIN    ASMASAMP ASSEMBLE A1                         DOGBOX
  L1 SYSLIB   BROOKES  MACLIB   A1                         DOGBOX
  L2          OSMACRO  MACLIB   S2                         MNT190
  L3          OSMACRO1 MACLIB   S2                         MNT190
  L4          DMSGPI   MACLIB   S2                         MNT190
     SYSLIN   ASMASAMP TEXT     A1                         DOGBOX
     SYSPRINT ASMASAMP LISTING  A1                         DOGBOX

  98138K allocated to Buffer Pool
    244 Primary Input Records Read         2217 Library Records Read
      0 ASMAOPT Records Read                485 Primary Print Records Written
     10 Object Records Written                0 ADATA Records Written
Assembly Start Time: 17.22.51 Stop Time: 17.22.51 Processor Time: 00.00.00.0407
Return Code 000

[ Top of Page | Previous Page | Next Page | Contents | Index ]