Subtract Assembler Instruction using RX Format |
The SimoTime Home Page |
This 370 Assembler program provides different techniques for using the RX Format of the Subtract 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.
The full word (4 bytes) located at the storage address specified by operand-2 (X2+B2+D2} is subtracted from a value that is stored in the register specified by operand-1(R1). Operand-2 remains unchanged. The condition code is set as shown below.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
S, Subtract Instruction, the operand format is R1,D2(X2,B2) |
This program may serve as a tutorial for programmers that are new to 370 Assembler and as a reference for experienced programmers.
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
The following is the mainframe JCL (AISUB0J1.jcl) required to run the assembler program. The JOB statement will need to be modified for specific mainframe environments. This will also run on a Windows System using Mainframe Express provided by Micro Focus.
//AISUB0J1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=O,NOTIFY=LRSP1 //* ******************************************************************* //* AISUB0J1.JCL - a JCL Member for Batch Job Processing * //* This JCL Member is provided by SimoTime Technologies * //* (C) Copyright 1987-2019 All Rights Reserved * //* Web Site URL: http://www.simotime.com * //* e-mail: helpdesk@simotime.com * //* ******************************************************************* //* //* Text - 370 Assembler, Subtract Instruction, RX Format //* Author - SimoTime Technologies //* Date - January 01, 1997 //* //* This 370 Assembler program provides different techniques for //* using the RX Format of the Subtract Instruction. //* //* ******************************************************************* //* Step 1 of 1, This is a single step job. //* //ASMWTOS1 EXEC PGM=AISUB0A1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //SYSOUT DD SYSOUT=* //*
This program (AISUB0A1.mlc) abides by the mainframe calling protocol and register usage guidelines. Register-15 is used to pass a return-code and register-14 contains the return address for the calling program. This program simply does a subtract of Register-15 from itself (i.e. setting the value to zero) and then does an unconditional branch to the address specified in Register-14.
*********************************************************************** * AISUB0A1.MLC - This is an HLASM Program * * Provided by SimoTime Technologies * * (C) Copyright 1987-2019 All Rights Reserved * * Web Site URL: http://www.simotime.com * * e-mail: helpdesk@simotime.com * *********************************************************************** * * * Created: 1976/06/01, Simmons * * Changed: 1976/06/01, Simmons, no changes to date... * * * *********************************************************************** * * Subtract, an RX Instruction, Mnemonic OpCode is S. * AISUB0A1 CSECT SAVE (14,12) BALR 12,0 USING *,12 WTO 'AISUB0A1 - Starting' *********************************************************************** * Step 1 of 3, Use standard Implied Base/Disp addressing... * L R5,FW04 * Load R5 with a value of 4 S R5,FW01 * Subtract 1 from R5 C R5,FW03 * Compare R5 for a value of 3 BNE ABEND03 WTO 'AISUB0A1 - Function Done with Calc/Compare 001' *********************************************************************** * Step 2 of 3, Use Explicit Base Reg with Index Reg... * L R5,FW04 * Load R5 with a value of 4 LA R4,8 * Load R4 with a value of 2 LA R6,FWGROUP S R5,0(R4,R6) * Subtract 2 from R5 C R5,FW02 * Compare R5 for a value of 2 BNE ABEND02 WTO 'AISUB0A1 - Function Done with Calc/Compare 002' *********************************************************************** * Step 3 of 3, Use Explicit Base/Disp addressing... * L R5,FW04 * Load R5 with a value of 4 LA R6,FWGROUP S R5,12(0,R6) * Subtract 3 from R5 C R5,FW01 * Compare R5 for a value of 1 BNE ABEND01 WTO 'AISUB0A1 - Function Done with Calc/Compare 003' *********************************************************************** RETURN EQU * WTO 'AISUB0A1 - Finished with RC=0000' SR R15,R15 * Set Return Code to Zero RETURN (14,12),RC=(15) *********************************************************************** ABEND01 EQU * WTO 'AISUB0A1 - ABENDING with RC=0001' LA R15,1 * Set Return Code to 0001 RETURN (14,12),RC=(15) *********************************************************************** ABEND02 EQU * WTO 'AISUB0A1 - ABENDING with RC=0002' LA R15,2 * Set Return Code to 0002 RETURN (14,12),RC=(15) *********************************************************************** ABEND03 EQU * WTO 'AISUB0A1 - ABENDING with RC=0003' LA R15,3 * Set Return Code to 0003 RETURN (14,12),RC=(15) *********************************************************************** DOMSG EQU * BR R3 *********************************************************************** FWGROUP DC 0F FW00 DC XL4'00000000' FW01 DC XL4'00000001' FW02 DC XL4'00000002' FW03 DC XL4'00000003' FW04 DC XL4'00000004' FWRK DC XL4'00000000' *********************************************************************** REGS END
This 370 Assembler program provides different techniques for using the RX Format of the Subtract Instruction. This document may be used to assist as a tutorial for new assembler programmers or as a quick reference for experienced programmers. The samples focus on the coding techniques of the individual instructions. As always, it is the programmer's responsibility to thoroughly test all programs.
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.
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.
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.
The following links may be to the current server or to the Internet.
Explore the Assembler Connection for more examples of mainframe Assembler programming techniques and sample code.
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.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
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.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
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.
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 |
S, Subtract Instruction, RX Format |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |