HLASM: V1R6 Programmer’s Guide - United States .High Level Assembler for z/OS & z/VM & z/VSE Programmer’s

  • View
    212

  • Download
    0

Embed Size (px)

Text of HLASM: V1R6 Programmer’s Guide - United States .High Level Assembler for z/OS & z/VM & z/VSE...

  • High Level Assembler for z/OS & z/VM & z/VSE

    Programmers Guide Release 6

    SC26-4941-05

  • High Level Assembler for z/OS & z/VM & z/VSE

    Programmers Guide Release 6

    SC26-4941-05

  • Sixth Edition (July 2008)

    This edition applies to IBM High Level Assembler for z/OS & z/VM & z/VSE, Release 6, Program Number 5696-234 and to any subsequent releases until otherwise indicated in new editions. Make sure you are using the correct edition for the level of the product.

    Order publications through your IBM representative or the IBM branch office serving your locality. Publications are not stocked at the address below.

    A form for readers comments is provided at the back of this publication. If the form has been removed, address your comments to:

    IBM Corporation Reader Comments

    DTX/E269 555 Bailey Avenue

    SAN JOSE, CA 95141-1003 U.S.A.

    When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you.

    Copyright International Business Machines Corporation 1982, 2008. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

    Note! Before using this information and the product it supports, be sure to read the general information under Notices on page 441.

  • Contents

    About this document . . . . . . . . . ix Who should use this document . . . . . . . . ix Programming interface information . . . . . . ix Organization of this document . . . . . . . . x IBM High Level Assembler for z/OS & z/VM & z/VSE Publications . . . . . . . . . . . . xi

    Hardcopy Publications . . . . . . . . . . xi Online publications . . . . . . . . . . xiii

    Related publications . . . . . . . . . . . xiii Syntax notation . . . . . . . . . . . . . xiii

    Summary of changes . . . . . . . . xvii

    Part 1. Understanding and using the assembler . . . . . . . . . . . . . 1

    Chapter 1. Introduction . . . . . . . . 3 Requirements . . . . . . . . . . . . . . 3

    System requirements . . . . . . . . . . . 3 Machine requirements . . . . . . . . . . 3 Storage requirements . . . . . . . . . . 4

    Compatibility . . . . . . . . . . . . . . 4 Assembler language support . . . . . . . . 4 Migration considerations . . . . . . . . . 5

    Chapter 2. Using the assembler listing . 7 High Level Assembler option summary . . . . . 8 External Symbol Dictionary (ESD) . . . . . . . 11 Source and object . . . . . . . . . . . . 14 Relocation dictionary (RLD) . . . . . . . . . 21 Ordinary symbol and literal cross reference . . . . 22 Unreferenced symbols defined in CSECTs . . . . 25 Macro and copy code source summary . . . . . 25 Macro and copy code cross reference . . . . . . 26

    Effects of LIBMAC and PCONTROL(MCALL) options . . . . . . . . . . . . . . . 28

    DSECT cross reference . . . . . . . . . . . 30 USING map . . . . . . . . . . . . . . 30 General Purpose Register cross reference . . . . 32 Diagnostic cross reference and assembler summary 33

    Chapter 3. Controlling your assembly with options . . . . . . . . . . . . 39 The sources of assembler options . . . . . . . 39

    Precedence of assembler options . . . . . . 39 Fixed installation default options . . . . . . 40 *PROCESS OVERRIDE Statement Options . . . 40 ASMAOPT options . . . . . . . . . . . 40 Invocation options . . . . . . . . . . . 40 *PROCESS statement options . . . . . . . 41 Default options . . . . . . . . . . . . 42 Invoking the assembler dynamically . . . . . 42 Coding rules . . . . . . . . . . . . . 42

    Assembler options . . . . . . . . . . . . 43 ADATA . . . . . . . . . . . . . . . 43 ALIGN . . . . . . . . . . . . . . . 44 ASA (z/OS and CMS) . . . . . . . . . . 45 BATCH . . . . . . . . . . . . . . . 45 CODEPAGE . . . . . . . . . . . . . 46 COMPAT . . . . . . . . . . . . . . 47 DBCS . . . . . . . . . . . . . . . 48 DECK . . . . . . . . . . . . . . . 48 DISK (CMS) . . . . . . . . . . . . . 49 DXREF . . . . . . . . . . . . . . . 49 ERASE (CMS) . . . . . . . . . . . . 49 ESD . . . . . . . . . . . . . . . . 50 EXIT . . . . . . . . . . . . . . . . 51 FLAG . . . . . . . . . . . . . . . 54 FOLD . . . . . . . . . . . . . . . 57 GOFF (z/OS and CMS) . . . . . . . . . 57 INFO . . . . . . . . . . . . . . . 59 LANGUAGE . . . . . . . . . . . . . 60 LIBMAC . . . . . . . . . . . . . . 60 LINECOUNT . . . . . . . . . . . . . 61 LIST . . . . . . . . . . . . . . . . 61 MACHINE . . . . . . . . . . . . . 62 MXREF . . . . . . . . . . . . . . . 64 OBJECT . . . . . . . . . . . . . . 65 OPTABLE . . . . . . . . . . . . . . 66 PCONTROL . . . . . . . . . . . . . 67 PESTOP . . . . . . . . . . . . . . 69 PRINT (CMS) . . . . . . . . . . . . . 69 PROFILE . . . . . . . . . . . . . . 70 RA2 . . . . . . . . . . . . . . . . 71 RENT . . . . . . . . . . . . . . . 71 RLD . . . . . . . . . . . . . . . . 72 RXREF . . . . . . . . . . . . . . . 72 SECTALGN . . . . . . . . . . . . . 73 SEG (CMS) . . . . . . . . . . . . . 73 SIZE . . . . . . . . . . . . . . . . 74 SUPRWARN . . . . . . . . . . . . . 76 SYSPARM . . . . . . . . . . . . . . 76 TERM . . . . . . . . . . . . . . . 77 TEST . . . . . . . . . . . . . . . 78 THREAD . . . . . . . . . . . . . . 78 TRANSLATE . . . . . . . . . . . . . 79 TYPECHECK . . . . . . . . . . . . . 79 USING . . . . . . . . . . . . . . . 81 WORKFILE . . . . . . . . . . . . . 83 XOBJECT (z/OS and CMS) . . . . . . . . 84 XREF . . . . . . . . . . . . . . . 84

    Chapter 4. Providing user exits . . . . 87 Exit types . . . . . . . . . . . . . . . 87 Specifying user exits . . . . . . . . . . . 88 Loading user exits . . . . . . . . . . . . 89 Calling user exits . . . . . . . . . . . . 90 Exit parameter list . . . . . . . . . . . . 90

    Copyright IBM Corp. 1982, 2008 iii

    | |

  • Request info pointer . . . . . . . . . . 91 Buffer pointer . . . . . . . . . . . . 98 Error buffer pointer . . . . . . . . . . . 98 Exit-specific information pointer . . . . . . 99 DCB pointer . . . . . . . . . . . . . 99 Static assembler information pointer . . . . . 99 HLASM Services Interface pointer . . . . . 100

    Error handling . . . . . . . . . . . . . 100 Exit-Specific Information Block . . . . . . . 100 SOURCE exit processing . . . . . . . . . . 104

    OPEN . . . . . . . . . . . . . . . 104 CLOSE . . . . . . . . . . . . . . 105 READ . . . . . . . . . . . . . . . 105 PROCESS . . . . . . . . . . . . . 105

    LIBRARY exit processing . . . . . . . . . 106 OPEN . . . . . . . . . . . . . . . 106 CLOSE . . . . . . . . . . . . . . 107 READ . . . . . . . . . . . . . . . 107 PROCESS MACRO or PROCESS COPY . . . 108 FIND MACRO or FIND COPY . . . . . . 109 END OF MEMBER . . . . . . . . . . 111

    LISTING exit processing . . . . . . . . . . 112 OPEN . . . . . . . . . . . . . . . 113 CLOSE . . . . . . . . . . . . . . 114 WRITE . . . . . . . . . . . . . . 114 PROCESS . . . . . . . . . . . . . . 115

    OBJECT (z/OS and CMS) and PUNCH exit processing . . . . . . . . . . . . . . 116

    OPEN . . . . . . . . . . . . . . . 117 CLOSE . . . . . . . . . . . . . . 118 WRITE . . . . . . . . . . . . . . 118 PROCESS . . . . . . . . . . . . . . 119

    ADATA exit processing . . . . . . . . . . 120 OPEN . . . . . . . . . . . . . . . 121 CLOSE . . . . . . . . . . . . . . 121 WRITE . . . . . . . . . . . . . . 122 PROCESS . . . . . . . . . . . . . 122

    TERM exit processing . . . . . . . . . . 123 OPEN . . . . . . . . . . . . . . . 124 CLOSE . . . . . . . . . . . . . . 124 WRITE . . . . . . . . . . . . . . 124 PROCESS . . . . . . . . . . . . . 125

    Sample user exits . . . . . . . . . . . . 126 User exit coding example . . . . . . . . . 126

    OBJECT and PUNCH exitOBJEXIT . . . . 127 ADATA ExitADEXIT . . . . . . . . . 127 TERM exitTRMEXIT . . . . . . . . . 127

    Chapter 5. Providing external functions . . . . . . . . . . . . . 145 External function processing . . . . . . . . 145 Linkage conventions . . . . . . . . . . . 146 External function parameter list . . . . . . . 146

    Request information list . . . . . . . . . 148 Pointer to user work area . . . . . . . . 150 Pointer to static assembler information . . . . 151 Pointer to msg buffer . . . . . . . . . . 151 Pointer to return string (SETCF) . . . . . . 151 Pointer to parm string n (SETCF) . . . . . . 151

    Chapter 6. Diagnosing assembly errors . . . . . . . . . . . . . . . 153 Assembly error diagnostic messages . . . . . . 153 MNOTE statements . . . . . . . . . . . 155 Suppression of error messages and MNOTE statements . . . . . . . . . . . . . . 156 Reference information for statements in error . . . 156 Abnormal assembly termination . . . . . . . 156 MHELPmacro trace facility . . . . . . . . 157

    Part 2. Developing assembler programs on z/OS . . . . . . . . 159

    Chapter 7. Assembling your program on z/OS . . . . . . . . . . . . . . 161 Input to the assembler . . . . . . . . . . 161 Output from the assembler . . . . . . . . . 161 Invoking the assembler on z/OS . . . . . . . 161 Invoking t