You are on page 1of 14

How to Read a z/OS Assembler Listing

Steve Pryor
DTS Software, LLC
steve@dtssoftware.com
1.919.833.8426
IGGCSISL


Sample IBM program to list entries in a catalog

Uses Catalog Search Interface

GPR 1 Address 1 Reason area


Address 2
Address 3 Selection
Critera

Work area

2
Assembler Language


Language Elements
– Machine Instructions
– Assembler Instructions
– Macro Instructions

Coding Conventions
– Statement field – columns 1 to 71

Continuation indicator column 72

Statement continuation column 16

Comments - ‘*’ in column 1
3
Important Instructions


Machine Instructions
– Load (L), Load address (LA), Move Characters (MVC), Branch (B, BAL, BNE, BC..)

Assembler Instructions
– USING – specify which registers are used when instructions are assembled
– DS / DC – define data areas and constants
– CSECT / DSECT - define program sections and maps

Macro Instructions
– GETMAIN/STORAGE, OPEN/CLOSE, GET/PUT, many more
4
Assembler Language


Statement format (1-4 entries: name, operation, operands, remarks)
– Fields separated by space
– Name entry

(1-64 characters, previously max 8), typically col 1 start
– Operation entry

Assembler mnemonic, machine instruction, macro, typically column 10 start
– Operand(s)

Separated by commas, may continue to next line, typically column 16 start
– Remarks (i.e., line comments)
5
Assembler Language – Symbols, Literals, Expressions


Ordinary Symbols
– Usually, 1-8 chars, alphameric

Internal symbols – from name field

External symbols – available to lked, binder, placed in ESD

Literals

Duplication factor – how many copies?

Type – what kind of literal? (address, fullword, character, hex…?)

Modifiers – length

Nominal value – value of the literal
– Assembled in to literal pool (LTORG)
6
Assembler Language – Instruction Addressing


Location counter
– Displacement into program or control block

Registers
– 16 GPRs 0-15, address 24, 31, or 64 bits

Base-displacement addressing
– Value in register (base) plus offset (displacement)

Limited to x’FFF’ (4095) bytes

Relative addressing

no. of halfwords from current location

7
CSECTS and DSECTS and USING


CSECT
– Control Section – usually, an executable program

DSECT
– Dummy section – usually, a control block

Reserves storage but does not put data into it

Referenced by base register + displacement

USING Instruction
– Specifies the base register for a section of code

8
Assembler Listing


Assembler Options and Overrides
– Options from EXEC PARM, //ASMAOPT, *PROCESS stmt
– List of options in effect

ESD – External Symbol Dictionary

External symbols for use by the Binder, section lengths
– SD
– ER – external reference

9
Assembler Listing


Source and Object Listing
– Columns

Location counter (offset)

Instruction object code

Operand locations (Addr1 Addr2)

Statement Number (and macro indicator)

Source Statement

10
Assembler Listing


Relocation Dictionary (RLD)
– Address constants that may be relocated by Binder

Ordinary Symbol and Literal Cross-Reference
– Symbols and literals defined and used in program
– Symbol type, value, where defined and referenced

Unreferenced symbols

Macro and Copy Code Source Summary
– Macros used and where they came from
11
Assembler Listing


DSECT Cross-Reference
– DSECTS used, length, where defined

USING Map
– Location of USING statements, type, and their addressable range

GPR Cross-Reference
– References to registers and type of reference

Diagnostic Cross-Reference
– Errors and statistics
12
Documentation and Further Info


https://www.ibm.com/docs/en/hla-and-tf/1.6

https://www.ibm.com/docs/en/hla-and-tf/1.6?topic=pdf-format-documentation
– HLASM Language Reference SC26-4940

– HLASM Programmer’s Guide SC26-4941



DFSMS Managing Catalogs SC23-6853
– Chapter 11 – The Catalog Search Interface

13
Summary / Q and A

Next webinar July 26, 2022
– An Introduction to Job Control Language

support@dtssoftware.com

Questions??? steve@dtssoftware.com
1-919-833-8426
Have an assembler background? Know someone who does? Call or email us!
Reminders

Current version 7.1 now available at www.dtssoftware.com

Companion DTS product use available n/c for a year – just ask!

Send your ACS routines or DTS product rules for complimentary analysis

You might also like