Modernization Hub

ASMH - High Level Assembler

Enhanced Definition

High Level Assembler (ASMH) is the primary assembler program for IBM z/OS, responsible for translating assembler language source code into machine-executable object code. It provides a powerful set of features for low-level system programming, performance-critical applications, and direct interaction with the z/Architecture hardware.

Key Characteristics

    • Macro Processing: Features a robust macro language that allows programmers to define and use macros, enabling code generation, abstraction, and reusability, significantly reducing repetitive coding.
    • Conditional Assembly: Supports directives such as AIF, AGO, ANOP, and MEXIT which allow for conditional code generation during the assembly process, adapting output based on specified conditions.
    • Symbolic Addressing: Permits the use of meaningful labels and symbols instead of absolute memory addresses, making programs more readable and maintainable.
    • Full z/Architecture Support: Directly maps to and supports the entire instruction set of the IBM z/Architecture, providing fine-grained control over hardware operations.
    • Object Module Output: Produces object modules (OBJ) as its primary output, which are then processed by the Linkage Editor (IEWL) to create executable load modules.
    • Comprehensive Listings: Generates detailed assembly listings that include the source code, corresponding object code, symbol tables, cross-references, and diagnostic messages.

Use Cases

    • Operating System Components: Developing or modifying critical parts of the z/OS operating system, such as Supervisor Call (SVC) routines, system exits, or specialized device drivers.
    • Performance-Critical Routines: Writing highly optimized code for applications where execution speed is paramount, often used for mathematical computations, I/O handling, or data manipulation.
    • System Exits and User Exits: Implementing custom logic at specific points within z/OS or other system software (e.g., SMF exits, JES exits, CICS user exits) to extend or alter standard behavior.
    • Hardware Interaction: Directly interacting with hardware features, control blocks, or specialized peripherals that are not easily accessible from higher-level languages.
    • Legacy System Maintenance: Maintaining, debugging, and enhancing existing mainframe applications and system utilities written in assembler language.

Related Concepts

ASMH is fundamental to the z/OS ecosystem. Its output (object modules) is typically linked by the Linkage Editor (IEWL) to create load modules, which are the executable programs stored in PDS or PDSE libraries. Assembler programs are often invoked via JCL for compilation and execution. Furthermore, ASMH is frequently used to write high-performance subroutines that are called from programs written in higher-level languages like COBOL, PL/I, or C/C++ to leverage its direct hardware access and optimization capabilities.

Best Practices:
  • Leverage Macros Judiciously: Use macros to encapsulate common code sequences, improve readability, and ensure consistency, but avoid over-complex macros that become difficult to debug.
  • Thorough Commenting: Assembler code is inherently low-level; extensive and clear comments are crucial for understanding program logic, especially for future maintenance.
  • Adhere to Linkage Conventions: Strictly follow standard z/OS linkage conventions (e.g., register usage, save area management) to ensure proper interoperability with other system components and programs.
  • Optimize for Readability First: While performance is a key reason for using assembler, prioritize clear, structured code over micro-optimizations that obscure logic, unless profiling indicates a critical bottleneck.
  • Utilize Conditional Assembly for Flexibility: Employ conditional assembly directives to create flexible code that can be adapted for different environments, hardware configurations, or release levels without maintaining multiple source files.

Related Products

Related Vendors

IBM

646 products

Related Categories

Performance

171 products

Operating System

154 products