Store Characters under Mask
Assembler Instruction using RS Format
  Table of Contents  v-24.01.01 - aistcm01.htm 
  Introduction
  The JCL Member
  The Mainline Assembler Program
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

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.

The bytes stored in the register specified by operand-1 (r1) are stored at the storage address specified by operand-2 (x2+b2+d2) under control of the mask (m3).

m3=0001, similar to STC
m3=0011, similar to STH
m3=1111, similar to ST
m3=0111, store 24-bit address

           
R1=register
 
 
   
   
   
   
   
B2=base register
D2=displacement
   
BE
RM
BDDD
STCM R1,M3,D2(B2)
M3=mask
 
 
   
   
Condition Code
The code remains unchanged.
 
STCM, Store Character under Mask Instruction, the operand format is R1,M3,D2(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-2024
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section The JCL Member

The following is the mainframe JCL (AISTCMJ1.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.

//AISTCMJ1 JOB SIMOTIME,ACCOUNT,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       AISTCMJ1.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   - Regression Test, HLASM, STCM Instruction
//* Author - SimoTime Technologies
//* Date   - January 01, 1989
//*
//* Multiple executions of the STCM Instruction using various masks.
//*
//* This set of programs will run on a mainframe under MVS or on
//* a Personal Computer running Windows and Mainframe Express by
//* Micro Focus.
//*
//*   ************
//*   * AISTCMJ1 *
//*   ********jcl*
//*        *
//*        *
//*   ************     ************
//*   * AISTCMA1 *-----*  SYSCON  *
//*   ********mlc*     ************
//*        *
//*   ************
//*   *   EOJ    *
//*   ************
//*
//* *******************************************************************
//* Step 1 of 1, This is a single step job.
//*
//AISTCMS1 EXEC PGM=AISTCMA1
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section The Mainline Assembler Program

This program (AISTCMA1.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 executes five (5) examples of the STCM Instruction.

***********************************************************************
*             AISTCMA1.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...                 *
*                                                                     *
***********************************************************************
*
* Store Characters Under Mask, an RS Instruction, Mnemonic is STCM.
*
AISTCMA1 CSECT
         SAVE (14,12)
         BALR  12,0
         USING *,12
         WTO   '* AISTCMA1 - Starting'
* Store Character under Mask
*
* STCM  R1,M3,D2(B2)
*
* The contents of OPERAND-1 is stored at
* OPERAND-2 under control of OPERAND-3.
*
         L     R5,=X'A0B1C2D3'         Initialize REGISTER for STCM's
*
***********************************************************************
* Step 1 of 6, The following STCM with a mask of X'F' (1111)
* is the same as a STORE (ST) instruction.
*
RT4MASKF EQU   *
         MVC   STCMDAT1(4),XFFL004   * Initialize target STORAGE
         STCM  R5,MASKF,STCMDAT1     * STORE all four bytes (1111)
*
         MVC   WTOMSG(76),WTOAOK     * Assume AOK
         CLC   STCMDAT1(4),STCMEXPF
         BE    *+14
         MVI   STATUS,C'4'
         MVC   WTOMSG(76),WTONOK
         MVC   WTOTAG(6),=CL6'MASK-F'
         BAS   R3,DOMSG              * DISPLAY MESSAGE, RETURN VIA R3
*
*
***********************************************************************
* Step 2 of 6, The following STCM with a mask of X'8' (1000)
* will store BYTE-0 of the contents of R5.
*
RT4MASK8 EQU   *
         MVC   STCMDAT2(4),X00L004   * Initialize target STORAGE
         STCM  R5,MASK8,STCMDAT2     * STORE BYTE-0 (1000)
*
         MVC   WTOMSG(76),WTOAOK     * Assume AOK
         CLC   STCMDAT2(4),STCMEXP8
         BE    *+14
         MVI   STATUS,C'4'
         MVC   WTOMSG(76),WTONOK
         MVC   WTOTAG(6),=CL6'MASK-8'
         BAS   R3,DOMSG              * DISPLAY MESSAGE, RETURN VIA R3
*
*
***********************************************************************
* Step 3 of 6, The following STCM with a mask of X'3' (0011)
* will store bytes 2 and 3 of the contents of R5,
* Performs the same function as a STORE- HALFWORD instruction (STH).
*
         MVC   STCMDAT3(4),X00L004   * Initialize target STORAGE
         STCM  R5,MASK3,STCMDAT3     * STORE BYTES 2 and 3 (0011)
*
         MVC   WTOMSG(76),WTOAOK     * Assume AOK
         CLC   STCMDAT3(4),STCMEXP3
         BE    *+14
         MVI   STATUS,C'4'
         MVC   WTOMSG(76),WTONOK
         MVC   WTOTAG(6),=CL6'MASK-3'
         BAS   R3,DOMSG              * DISPLAY MESSAGE, RETURN VIA R3
*
*
***********************************************************************
* Step 4 of 6, The following STCM with a mask of X'7' (0111)
* will store bytes 1, 2 and 3 of the contents of R5, this may
* be used to store 24-bit (3-BYTE) addresses into control blocks.
*
         MVC   STCMDAT4(4),X00L004   * Initialize target STORAGE
         STCM  R5,MASK7,STCMDAT4     * STORE BYTES 1, 2 and 3 (0111)
*
         MVC   WTOMSG(76),WTOAOK     * Assume AOK
         CLC   STCMDAT4(4),STCMEXP7
         BE    *+14
         MVI   STATUS,C'4'
         MVC   WTOMSG(76),WTONOK
         MVC   WTOTAG(6),=CL6'MASK-7'
         BAS   R3,DOMSG              * DISPLAY MESSAGE, RETURN VIA R3
*
***********************************************************************
* Step 5 of 6, The following STCM with a mask of X'7' (0101)
* will store bytes 1 and 3 of the contents of R5.
*
         MVC   STCMDAT5(4),X00L004   * Initialize target STORAGE
         STCM  R5,MASK5,STCMDAT5     * STORE BYTES 1 and 3 (0101)
*
         MVC   WTOMSG(76),WTOAOK     * Assume AOK
         CLC   STCMDAT5(4),STCMEXP5
         BE    *+14
         MVI   STATUS,C'4'
         MVC   WTOMSG(76),WTONOK
         MVC   WTOTAG(6),=CL6'MASK-5'
         BAS   R3,DOMSG              * DISPLAY MESSAGE, RETURN VIA R3
*
***********************************************************************
* Step 6 of 6, The following STCM with a mask of X'A' (1010)
* will store bytes 0 and 2 of the contents of R5.
*
         MVC   STCMDAT6(4),X00L004   * Initialize target STORAGE
         STCM  R5,MASKA,STCMDAT6     * STORE BYTES 0 and 2 (1010)
*
         MVC   WTOMSG(76),WTOAOK     * Assume AOK
         CLC   STCMDAT6(4),STCMEXPA
         BE    *+14
         MVI   STATUS,C'4'
         MVC   WTOMSG(76),WTONOK
         MVC   WTOTAG(6),=CL6'MASK-A'
         BAS   R3,DOMSG              * DISPLAY MESSAGE, RETURN VIA R3
*
***********************************************************************
RETURN   EQU   *
         CLI   STATUS,C'0'
         BNE   ABEND04
         WTO   '* AISTCMA1 - Finished with RC=0000'
         SR    R15,R15               * Set Return Code to Zero
         RETURN (14,12),RC=(15)
*
***********************************************************************
ABEND04  EQU   *
         WTO   '* AISTCMA1 - ABENDING with RC=0004'
         LA    R15,4                 * Set Return Code to 0004
         RETURN (14,12),RC=(15)
***********************************************************************
STCMDATA DS    0H
STCMDAT1 DC    XL4'00000000'
STCMDAT2 DC    XL4'00000000'
STCMDAT3 DC    XL4'00000000'
STCMDAT4 DC    XL4'00000000'
STCMDAT5 DC    XL4'00000000'
STCMDAT6 DC    XL4'00000000'
*
STATUS   DC    CL1'0'
         DS    0H
STCMEXPF DC    XL4'A0B1C2D3'
STCMEXPA DC    XL4'A0C20000'
STCMEXP8 DC    XL4'A0000000'
STCMEXP7 DC    XL4'B1C2D300'
STCMEXP5 DC    XL4'B1D30000'
STCMEXP3 DC    XL4'C2D30000'
*
X00L004  DC    XL4'00000000'
XFFL004  DC    XL4'FFFFFFFF'
*
MASKF    EQU   X'F'
MASKA    EQU   X'A'
MASK8    EQU   X'8'
MASK7    EQU   X'7'
MASK5    EQU   X'5'
MASK4    EQU   X'4'
MASK3    EQU   X'3'
MASK2    EQU   X'2'
MASK1    EQU   X'1'
*
***********************************************************************
* The following is an example of a user-coded WTO buffer.
*
         DS    0H            * INSURE HALF-WORD ALIGNMENT
WTOBLOCK EQU   *
         DC    H'80'         * For WTO, length of WTO buffer...
         DC    H'0'                     should be binary zeroes...
WTOMSG   EQU   *
         DC    CL22'* AISTCMA1 - USERINFO '
WTOTAG   DC    CL06'WTOTAG'
         DC    CL48' User message goes here                         '
*
WTONOK   EQU   *
         DC    CL22'* AISTCMA1 - ABENDING '
         DC    CL06'WTOTAG'
         DC    CL48' NOK, Actual NE expected                        '
WTOAOK   EQU   *
         DC    CL22'* AISTCMA1 - Executed '
         DC    CL06'WTOTAG'
         DC    CL48' AOK, Actual EQ expected                        '
*
***********************************************************************
* Common WTO routine to display WTOBLOCK...
*
DOMSG    EQU   *
         WTO   MF=(E,WTOBLOCK)
         BR    R3                    * Return via Register 3
***********************************************************************
         REGS
         END

Table of Contents Previous Section Next Section Summary

This 370 Assembler program provides different techniques for using the RS Format of the Store Characters under Mask 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.

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.

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

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
STCM, Store Characters under Mask, RS Format
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com