The Assembler Connection
Mainframe Assembler
  Table of Contents  v-24.01.01 - indexasm.htm 
  Introduction
  The 370 Assembler Instructions
  Instruction Overview
  Extended Mnemonics for Branching
  Sample 370 Assembler Programs
  The 370 Assembler Instruction Set
  370 Assembler Coding Techniques
  A Very Simple Assembler Program
  The Write To Operator (WTO) Macro
  Call, Load and Link
  Non-Executable & Composite Link
  KSDS Access, Assembler I/O Routine
  QSAM Access, Assembler I/O Routine
  Bit Processing, COBOL calls Assembler
  User Labels & Expanded Macro Code
  Macro and Copy Files
  Assembler Calling COBOL
  EBC to ASC Convert Programs
  Mainframe 370 Instructions
  Edit and Mark (SS)
  Store Characters under Mask (RS)
  Subtract (RX)
  Translate (SS)
  Mainframe Assembler Management
  Non-Executable Load Members
  Alternatives for Application Migration
  Assembler Development Environment
  Assembler Source Code Analysis
  Assembler Analysis Tool
  Assembler Analysis Messages
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview

Table of Contents Previous Section Next Section Introduction

The Assembler Connection provides a suite of sample programs and test cases that are written to assemble and link using IBM Assembler/H or IBM High Level Assembler (HLASM) when possible. If a technique is used that is unique to a specific dialect it will be noted. JCL members are provided to run the jobs as MVS or ZOS batch jobs on an IBM Mainframe System. The source members may be transferred to a Windows Systems and then compiled and executed using Micro Focus Enterprise Developer with the Mainframe sub-system option enabled.

Micro Focus provides a functionally rich mainframe assembler emulator with built-in debugging tools that allow a programmer to step through a program executing one line of source code at a time and viewing the results of register and memory content. If a technique is used that is unique to the mainframe and is not supported by Micro Focus Enterprise Developer then it will be noted. Refer to http://www.microfocus.com for more information.

The Assembler Connection also provides summary documentation for the problem-state instruction set plus detailed documentation for each of the examples. It is intended to be a reference resource for experienced programmers and a learning resource for programmers that want to become familiar with mainframe assembler programming.

Over the years many different approaches or coding techniques have been used to solve both technical and business problems. In today's programming environment some of the approaches or techniques are considered poor coding practices. Some of these techniques were used because of the limitations of the technology at the time. Others were exceedingly clever in their approach and are often difficult to understand and a real challenge to maintain or change. Clarity is usually preferable over cleverness.

Since one of our objectives is to provide information for the maintenance programmer we have included the good, the bad and the ugly. We have tried to note the examples that are considered as poor coding practices or overly clever approaches.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section The 370 Assembler Instructions

Briefly describe the mnemonic opcodes for the 370 problem-state, non-floating point instructions and the extended mnemonic opcodes for the branch instructions.

Table of Contents Previous Section Next Section Instruction Overview

This document briefly describes the mnemonic opcodes for the 370 problem-state, non-floating point instructions. This is a large document (approximately 675K).

Table of Contents Previous Section Next Section Extended Mnemonics for Branching

This document provides a quick reference for the extended mnemonic opcodes for the branch instructions. The format of the instruction and generated mask value is provided.

Table of Contents Previous Section Next Section Sample 370 Assembler Programs

This section provides a brief description of each of the sample Assembler programs. Also, a link for downloading or accessing detailed information is provided.

Table of Contents Previous Section Next Section The 370 Assembler Instruction Set

This program provides examples of the syntax used to code the mainframe, 370 assembler, problem-state, non-floating-point instructions. The real value is in the animation of this program using Mainframe Express provided by Micro Focus. This program will execute each of the instructions in alphabetic sequence. You can immediately see the results of each instruction execution. This is a very effective way to become familiar with the 370 instruction set.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section 370 Assembler Coding Techniques

This section discusses some of the coding techniques used by mainframe assembler programmers.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section A Very Simple Assembler Program

This is a very simple program that sets the return code to zero and returns to the calling program.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section The Write To Operator (WTO) Macro

The WTO macro (Write-To-Operator) is used to display messages upon the console.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Call, Load and Link

This suite of programs provides examples of how a mainframe assembler program calls, loads or links to a mainframe assembler (HLASM) routine.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Non-Executable & Composite Link

This suite of programs provides an example of how a COBOL program can call an Assembler program that is a composite link of multiple Assembler members. The primary Assembler program will execute a secondary program using a VCON and Branch. The primary Assembler will load a non-executable member that is a data table.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section KSDS Access, Assembler I/O Routine

This program suite provides an example of how a mainline COBOL program calls a mainframe assembler (HLASM) I/O routine to access a VSAM data set. The COBOL program is written using COBOL/2 dialect but also works with COBOL for MVS and COBOL/370. The assembler IO routine is written in IBM Mainframe Assembler, it will compile using Assembler/H or HLASM.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section QSAM Access, Assembler I/O Routine

This program suite provides an example of how a mainline COBOL program calls a mainframe assembler (HLASM) I/O routine to access a QSAM, sequential file. The COBOL program is written using COBOL/2 dialect but also works with COBOL for MVS and COBOL/370. The assembler IO routine is written in IBM Mainframe Assembler, it will compile using Assembler/H or HLASM.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Bit Processing, COBOL calls Assembler

This is an example of how a COBOL program can call an Assembler program that does bit-level manipulation. The COBOL program is written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370. The Assembler program was originally written using the IBM Mainframe Assembler/H and will work with HLASM.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section User Labels & Expanded Macro Code

The creation and usage of labels within a mainframe assembler program is usually an easy task. One of the challenges in larger programs is to create unique labels. The task of maintaining unique labels presented a bigger problem when using macros that generated code that included branch instructions. There are various techniques used to solve this problem and each has its own advantages and disadvantages.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Macro and Copy Files

The primary objective of this program is not in the execution process but in the compile process. Since the reference to the second macro (MACCPYB2.cpy) is stored as a copy file the Micro Focus Assembler must be configured to handle multiple extensions for macro files.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Assembler Calling COBOL

This suite of programs provides an example of how a High Level Assembler (HLASM) program calls a COBOL program. The assembler program is written in IBM Mainframe Assembler, it will compile using Assembler/H or HLASM. A JCL member is provided to run the job as an MVS batch job on an IBM mainframe or as a batch job running on a Windows System with Micro Focus Enterprise Developer.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section EBC to ASC Convert Programs

The primary purpose of this suite of job scripts and programs is to describe and demontrate how to convert EBCDIC encoded text string to ASCII encoded text strings. The conversion process may be executed using COBOL or HLASM programs. The first program does the file I/O processing by reading a record sequential, calling a second program to do the record content conversion and writing to a record sequential file.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Mainframe 370 Instructions

The following group of programs will focus on specific 370 Instructions. The programs and documentation will show the physical structure of the machine-language (i.e. 360/370 format) instruction. The Assembler programs have been written to conform to the Assembler/H or High Level Assembler (HLASM) dialects.

Table of Contents Previous Section Next Section Edit and Mark (SS)

This test case will execute a job (or Job Script) that will prepare a numeric value for a review process that requires human observation. The numeric value is stored in a packed-decimal format. The Jobs will execute an Assembler program that uses the Edit and Mark (EDMK) Instruction. The assembler program is written to comply with an IBM Mainframe Assembler dialect. The program will compile using Assembler/H or HLASM. A JCL member is provided as a job script to run as a batch job on an IBM Mainframe System with ZOS or a Windows System with Micro Focus Enterprise Developer.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Store Characters under Mask (RS)

This 370 Assembler program provides different techniques for using the RS Format of the Store Characters under Mask (or STCM) Instruction. The assembler program is written to comply with an IBM Mainframe Assembler dialect. The program will compile using Assembler/H or HLASM. A JCL member is provided as a job script to run as a batch job on an IBM Mainframe System with ZOS or a Windows System with Micro Focus Enterprise Developer.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Subtract (RX)

This 370 Assembler program provides different techniques for using the RX Format of the Subtract Instruction. The assembler program is written in IBM Mainframe Assembler, it will compile using Assembler/H or HLASM. A JCL member is provided to run the job as an MVS batch job on an IBM mainframe or as a project with Micro Focus Mainframe Express (MFE) running on a Windows System.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Translate (SS)

This 370 Assembler program provides different techniques for using the SS Format of the Translate (TR) Instruction. The assembler program is written to comply with an IBM Mainframe Assembler dialect. The program will compile using Assembler/H or HLASM. A JCL member is provided as a job script to run as a batch job on an IBM Mainframe System with ZOS or a Windows System with Micro Focus Enterprise Developer.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Mainframe Assembler Management

User programs that were coded using the IBM Mainframe Assembler Language can be compiled and executed on a Windows System using Micro Focus Technologies. Assembler source members that define user data tables (i.e. non-executable load members) may be compiled and accessed using Micro Focus Technologies or SimoTime Technologies.

Table of Contents Previous Section Next Section Non-Executable Load Members

In the CICS environment on the mainframe it was a common practice to use the EXEC CICS LOAD function to load a data table into memory. These data tables were typically created as mainframe assembler source members. The source members were then compiled and linked as non-Executable load members.

This example will describe how to Create a Non-Executable Member from Assembler Source Code for the Micro Focus Studio and Server environments running in EBCDIC or ASCII by reading the source member and creating a .MOD file.

Table of Contents Previous Section Next Section Alternatives for Application Migration

When performing a migration of an application from the mainframe (EBCDIC encoded with base, displacement addressing in 24 or 31 bit mode using the big endian format) to a Linux, UNIX or Windows platform (usually ASCII encoded with 32 or 64 bit addressing and little endian format) the Assembler programs create a challenge.

This white paper will present Information and Alternatives for Application Migration of COBOL-oriented applications (batch or online CICS) with some assembler programs. The target platform may be Linux, UNIX or Windows with Micro Focus Server.

Table of Contents Previous Section Next Section Assembler Development Environment

This document provides an introduction to the installation, configuration and usage of the mainframe assembler capability on a Windows System using Micro Focus technology and Enterprise Developer. An Assembler sub-system is created within a larger, Mainframe-Oriented sub-system that executes Batch Jobs using JCL Members.

This white paper will describe the usage of Assembler in an Application Development and Test Environment with the Production Environment remaining on the Mainframe System.

Table of Contents Previous Section Next Section Assembler Source Code Analysis

Business applications running on an IBM Mainframe System may be written in a variety of programming languages. Some applications have been in production for over twenty-five (25) years. These applications were typically written in COBOL with a few Assembler programs. Over the years the application maintenance was primarily focused on the COBOL programs and the Assembler remained quietly in the background and was rarely modified.

In today's environment companies want the flexibility of moving processing across a variety of platforms and the Assembler programs present a challenge. A process to programmatically scan and analyze the Assembler Source code would be quite helpful in getting off to a faster start.

Table of Contents Previous Section Next Section Assembler Analysis Tool

SIMOX390 is a mainframe Assembler Analysis Tool. This version of SIMOX390 runs on a Windows System and scans mainframe assembler source members that have been downloaded and identifies the macro and copy files used by the programs. This tool should be used in conjunction with a pilot test that would actually assemble, link, and execute a sample test case of an actual application.

This white paper will describe the usage of the Assembler Analysis Tool and the source code scanning process.

Table of Contents Previous Section Next Section Assembler Analysis Messages

This document provides a list of the possible informational or error messages that may be issued by the Assembler Analysis Tool during the member scanning and analysis process of the HLASM source code.

This white paper will describe the Program Messages issued by the Assembler Analysis Tool.

Table of Contents Previous Section Next Section Summary

The purpose of this document is to assist as a tutorial for new programmers or as a quick reference for experienced programmers that are interested in the High Level Mainframe Assembler Language (HLASM). Links to additional documents and programming examples are provided.

In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note: A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore How to Document Record Layouts or other Data Structures using a COBOL copy file. For reference or documentation purposes SimoREC1 creates an ASCII/Text file and an HTML document from a COBOL copy file. The utility provides the length of a field and the position of the start of the field within a record. Also, the actual physical length for group items, packed fields, binary fields and tables will be calculated.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

Link to Internet   Link to Server   Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.

Link to Internet   Link to Server   Explore the SQL Connection for more examples of how to create, manipulate and delete Relational Data Bases. The COBOL programs are written to compile and execute on a Windows System with SQL Server and Micro Focus Enterprise Server or an IBM Mainframe System with DB2.

Link to Internet   Link to Server   Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.

Link to Internet   Link to Server   Explore the Numbers Connection for additional information about the structure and processing of numeric data items (or numeric fields).

Link to Internet   Link to Server   Explore Assembler Alternatives for a COBOL-Oriented Application Migration with some assembler programs. The target platform may be Linux, UNIX or Windows with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
The Assembler Connection by SimoTime Technologies
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com