Translate
Assembler Instruction using SS Format
  Table of Contents  v-24.01.01 - aitr0001.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 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.

The bytes at the storage address specified by operand-1 (b1+d1) are replaced by the byte located at the calculated address within operand-2 (b2+d2).

The address is calculated from x2+d2 and the byte value from operand-1

               
LL=length
from x'00' to x'FF'
 
 
   
   
   
   
B2=base register
D2=displacement
   
DC
LL
BDDD
BDDD
TR D1(L,B1),D2(B2)
   
B1=base register
D1=displacement
 
 
 
 
   
   
Condition Code
The code remains unchanged
 
TR, Translate Instruction, the operand format is D1(L,B1),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-2025
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section The JCL Member

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

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

Table of Contents Previous Section Next Section The Mainline Assembler Program

This program (AITR00A1.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 a routine that use the TR Instruction to convert a string of lower case characters to upper case. A HEX-Dump routine is used to display the memory used by the program.

***********************************************************************
*             AITR00A1.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...                 *
*                                                                     *
***********************************************************************
*
* Translate, an SS Instruction, Mnemonic OpCode is TR.
*
AITR00A1 CSECT
         SAVE (14,12)
         BALR  12,0
         USING *,12
         WTO   '* AITR00A1 - Starting'
* Translate Instruction
*
*        TR    D1(L,B1),D2(B2)
*
* The bytes at the storage address specified by operand-1 (b1+d1) are
* replaced by the byte located at the calculated address within
* operand-2 (b2+d2).
*
***********************************************************************
* Step 1 of 6, The following will convert Lower-Case to Upper Case.
*
LCTOUC   EQU   *
         MVC   STRINGW1(26),STRINGLC   * Initialize target STORAGE
         MVC   WTO048(26),STRINGW1     *
         MVC   WTOTAG(6),=CL6'Begin '
         BAS   R3,DOMSG                * Post Message, Return via R3
*
         TR    STRINGW1(26),ASML2UB1   * Convert to Upper Case
*
         MVC   WTO048(26),STRINGW1     *
         MVC   WTOTAG(6),=CL6'After '
         BAS   R3,DOMSG                * Post Message, Return via R3
*
*
***********************************************************************
* Step 2 of 6, Convert and display one byte of binary to two bytes
*              of text for HEX-Dump.
*
DUMPONE   EQU   *
         MVI   UBYTE01,X'4A'           * Prepare test byte
         BAS   R7,BIN2TXT              * Convert to Text for HEX-Dump
*
         MVI   WTO048,C' '
         MVC   WTO048+1(47),WTO048
         MVC   WTO048(2),WORK04+1      *
         MVC   WTOTAG(6),=CL6'(HEX) '
         BAS   R3,DOMSG                * Post Message, Return via R3
*
*
***********************************************************************
* Step 3 of 6, Convert a data string that may contain binary data to
*              a data string of text in a HEX-Dump format that may be
*              displayed.
*
DUMP16   EQU   *
         LA    R6,TXTX16               * Set Start Addr of Data String
*
         MVI   WTO048,C' '             * Prepare to clear WTO Buffer
         MVC   WTO048+1(47),WTO048     * Clear the WTO Buffer
         MVC   WTO048(16),0(R6)        * Move Data String to WTO Buffer
*
         MVC   WTOTAG(6),=CL6'(TXT) '
         BAS   R3,DOMSG                * Post Message, Return via R3
         MVI   WTO048,C' '             * Prepare to clear WTO Buffer
         MVC   WTO048+1(47),WTO048     * Clear the WTO Buffer
*
         LA    R8,16                   * Initialize the Loop Counter
         LA    R2,WTO048               * Set Start Addr for WTO Buffer
DUMP16L1 EQU   *
         MVC   UBYTE01(1),0(R6)        * Initialize target STORAGE
         BAS   R7,BIN2TXT              * Convert to Text for HEX-Dump
*
         MVC   0(2,R2),WORK04+1        * Move Hex-Text to WTO Buffer
         LA    R2,2(,R2)               * Incr Addr in WTO Buffer
         LA    R6,1(,R6)               * Incr Addr in Data String
         BCT   R8,DUMP16L1             * Loop until REG-8 goes to ZERO
*
         MVC   WTOTAG(6),=CL6'(HEX) '
         BAS   R3,DOMSG                * Post Message, Return via R3
         B     RETURN
*
*
***********************************************************************
RETURN   EQU   *
         CLI   STATUS,C'0'
         BNE   ABEND04
         WTO   '* AITR00A1 - Finished with RC=0000'
         SR    R15,R15                 * Set Return Code to Zero
         RETURN (14,12),RC=(15)
*
***********************************************************************
ABEND04  EQU   *
         WTO   '* AITR00A1 - ABENDING with RC=0004'
         LA    R15,4                   * Set Return Code to 0004
         RETURN (14,12),RC=(15)
*
***********************************************************************
* Convert ONE-Byte Binary to TWO-Bytes of Text for Hex-Dump
*
BIN2TXT  EQU   *
         MVC   BIN4G(4),=X'00000000'   * Initialize BIN work area
         MVC   BIN4G+2(1),UBYTE01
         L     R4,=X'00000010'         * Prepare to Shift left
         MH    R4,BIN4AXIS             * Do the Shift left
         STH   R4,BIN4AXIS             * Save the Hi-Order nibble
         LH    R4,BIN4EAST             * Prepare to Shift right
         L     R5,=X'0000FFFF'
         NR    R5,R4                   * Ensure halfword Integrity
         SR    R4,R4                   * Clear Even Pair Register
         D     R4,=X'00000010'         * Do the Shift right
         STH   R5,BIN4EAST             * Save the Lo-Order nibble
*
         MVC   WORK04(4),BIN4G         * Initialize target STORAGE
         TR    WORK04+1(2),HEXTXT      * Convert BIN to TXT
         BR    R7                      * Return via Register 7

***********************************************************************
USERDATA DS    0H
STRINGLC DC    CL26'abcdefghijklmnopqrstuvwxyz'
STRINGUC DC    CL26'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
STRINGW1 DC    26XL1'00'
TXTX16   DC    CL16'Part-1,  Part-2 '
*
STATUS   DC    CL1'0'
         DS    0H
*
UBYTES   DS    0H
UBYTE01  DC    XL1'00'
UBYTE02  DC    XL1'00'
UBYTE03  DC    XL1'00'
UBYTE04  DC    XL1'00'
*
BIN4G    DS    0F
         DC    X'00'
BIN4AXIS DC    XL2'003A'
         DC    X'00'
BIN4GR   ORG   BIN4G
BIN4WEST DS    XL2
BIN4EAST DS    XL2
*
WORK04   DC    4XL1'00'
HEXBIN   DC    XL16'0102030405060708090A0B0C0D0E0F'
HEXTXT   DC    CL16'0123456789ABCDEF'
*
X00L004  DC    XL4'00000000'
XFFL004  DC    XL4'FFFFFFFF'
*
         COPY  ASM256B1
         COPY  ASML2UB1
*
***********************************************************************
* 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'* AITR00A1 - USERINFO '
WTOTAG   DC    CL06'WTOTAG'
WTO048   DC    CL48' User message goes here                         '
*
WTONOK   EQU   *
         DC    CL22'* AITR00A1 - ABENDING '
         DC    CL06'WTOTAG'
         DC    CL48' NOK, Actual NE expected                        '
WTOAOK   EQU   *
         DC    CL22'* AITR00A1 - Executed '
         DC    CL06'WTOTAG'
         DC    CL48' AOK, Actual EQ expected                        '
WTOSTR   EQU   *
         DC    CL22'* AITR00A1 - USERDATA '
         DC    CL06'WTOTAG'
         DC    CL48' User Data goes here                            '
*
***********************************************************************
* 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 program executes a routine that use the TR Instruction to convert a string of lower case characters to upper case. A HEX-Dump routine is used to display the memory used by the program. 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 How to convert an EBCDIC encoded text string to an ASCII encoded text strings using COBOL programs or HLASM programs that will read an EBCDIC encoded record sequential file and produce an ASCII encoded record sequential file.

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
TR, Translate Instruction, SS Format
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com