Return to sysprog.net home page

españolfrançaisdeutsch

Assembler

Main page

New opcodes

SITE SERVICES
Contact Us
Search
Site Map


 Home —» HLASM —» New HLASM commands


HLASM - High Level Assembler Language: New Commands


flowchartHigh Level Assembler Language is used mostly these days by systems programmers for writing exits, and by developers of systems software. This is a summary of some of the operations that have changed, or been added, in recent years. For more detailed information check POPs (s/390), or Pops (z/OS), the Principles of Operations manual.



Branch Instructions that Don't Use the Stack

BAL and BALR: Branch And Link/Register is obsolete in S/390. Unless you need backward compatibility with MVS/XA, use BAS/BASR. BAL/R puts non-address information in the high-order bits.

BAS and BASR: Branch And Save/Register is used to branch within a program, or to another program with the same AMODE (addressing mode). If you need to branch between 24 and 31-bit programs, use BASSM and BSM.

label    BAS     R14,ROUTINE
label    BASR    R14,R15

BASSM and BSM: Branch And Save And Set Mode is used to branch to a program in a different AMODE. Use Branch and Set Mode (BSM) with zero in the first operand to return to the calling program.


Halfword Immediate Instructions

AHI, CHI, LHI and MHI: The Halfword Immediate instructions work just like the CLI instruction, but the 16-bit binary value is added to, compared with, loaded from, or multiplied by the two low order bytes in the register.

label    AHI     R3,64
label    CHI     R3,64
label    LHI     R3,64
label    MHI     R3,64


Multiply Single Instruction

MSR: The Multiply Single operation only uses two registers. No condition code is set, and no overflow indication is given.

label   MSR     R3,R8


String Commands

CUSE: Compare Until Substring Equal compares two strings, looking for an identical substring in both of them. The operation uses two pairs of even-odd registers. The first pair contain the address and length of the first string: the second pair contain the address and length of the second string. Registers 0 and 1 contain the length of the substring and the padding byte, if one string is shorter than the other. The condition code is set, and if a match is found, the addresses of the two substrings are returned in registers 1 and 2.

label    CUSE     R4,R8

CLST: Compare Logical String compares the two strings whose addresses are in the two registers. Register 0 contains the character used to identify the end of string. The condition code is set, and if a mismatch is found before the end of the shorter string, the addresses of the unequal bytes in each string are returned in registers 1 and 2.

label    CLST     R4,R5

MVST: Move Logical String moves the string at the location specified by the second register to the address specified by the first. Register 0 contains the character used to identify the end of string.

label    MVST      R4,R5

SRST: Search String searches the string whose starting address is in the second register, and ending address in the first register. Register 0 contains the character to search for. If the character is found, its address is returned in register 1. If a match is not found, register 2 may contain the address of the next byte to be searched.

label    SRST     R4,R5


Test Under Mask

TMH and TML: These Test under Mask instructions test the high or low-order two bytes of the register with the 16-bit operand. The condition code is set the same way as in TM (Test under Mask).

label    TMH     R3,MASK
label    TML     R3,MASK


Compare and Swap and Purge

CSP: This new instruction is not yet detailed in POPs. But, you can read the new pages here.



TOP OF PAGE The most exciting phrase to hear in science, the one that heralds new discoveries,
is not 'Eureka!' (I found it!) but 'That's funny....'
(Isaac Asimov)