Instructions – What you ‘really’ need

If you take a look at the list of instructions in the Principles of Operation manual there are gobs and gobs of instructions in the general instructions section alone, not helped by the fact that pretty much every instruction now has one or more Y and G versions. So I got to thinking about what instructions do you ‘really’ need to use to write ‘most’ code and the list is surprisingly small.

Executable instructions:
L                 Load (a register from storage)
LTR               Load and Test Register
ST                Store (a register into storage)
MVC               MoVe Characters (storage to storage move, max 256)
MVCL              MoVe Characters Long (Storage to Storage move, 16Meg max)
CLC               Compare Logical Characters (max 256)
BC                Branch on Condition
LA                Load Address (Of storage into a register)
IC/ICM            Insert Character/Insert Character under Mask (storage to register)
STC/STCM          Store Character/Store Character under Mask (register to storage)
BAL/BALR          Branch And Link (to address)/Branch And Link Register (to address in register)
LH                Load Halfword (storage into register)
MH                Multiply Halfword (register by storage contents)
M                 Multiple (register by storage contents)
TR/TRT            TRanslate/TRanslate and Test (Character conversion/testing)
MVI               MoVe Immediate (in instruction value to storage)
CLI               Compare Immediate (in instruction value to storage)
SLR               Subtract Logical Registers (usually used to zero a register)
XR/XC             eXclusive oR Register/ eXclusive oR Storage (usually user to zero registers and storage)
Assembler 'instructions':
DC                Declare Constant (Not really an instruction, reserves storage and initializes it to a value)
DS                Declare Storage (not really and instruction, reserves storage, no initialization)
CSECT/DSECT       Not really instructions. Define start of a code or data section
EQU               not really an instruction. Equates a name with some value (explicit or calculated)

OK, so it’s not exhaustive, I can think of a few others I sometimes use like Add Halfword, Shift Left/Right/ Divide etc but for ‘most’ code I think the above list would cover most of your needs. In fact, some of that list are not even ‘instructions’ because they don’t create executable code. Rather they are instructions to the assembler but since you will often use them I thought it was valid to include them here.

Of course, if you want to take advantage of the newer features of the system Z architecture by using the Y and G type instructions then the list grows but even then, those instructions are really just variations on the above, they stil do essentially the same thing as the core instruction, just of bigger areas of storage or using 64 bit registers.

  1. Jill Curry
    July 17, 2012 at 7:17 pm

    I so agree with this list, although find browsing new instructions in POPs entertaining. I am also fond of the to execute instruction..

  1. No trackbacks yet.

Leave a comment