This is the 360 (with some 370) instruction set. There are more instructions. You'll never use them.
Look at this when you're starting. Won't make much sense.
6 months later, look again, it'll make more sense. A year or 2 later, it'll make even more sense.
Instruction op-codes (you see 'em in a dump, or when you're using TEST) are all 1 hex byte.
In the table, the first half of the op-code byte (hex digit) is at the start of each row.
The second half of the op-code byte (other hex digit 0-F) is along the top.
So, in this list, an opcode of x'47' would be in the #4 row,
and under the '7' column. If you go down the '7' column
to the 4? row, you see "BC" which is the branch instruction. (Branch Conditional)
This is the instruction set that was devised by Gene Amdahl,
who later went on to form his own company and compete with IBM.
Instruction types are: RR (2 byte) Register to Register instructions (no memory involved),
RX (4 byte) Register + Index instructions, where 2 registers + offset add up to the memory location,
RS (4 byte) Register+Register instructions have 2 object registers, like LM load multiple 4,8,location
SI (4 byte) Storage Immediate, involves 1 data byte in the instruction, and memory,
SS (6 byte) Storage - Storage, involves 2 storage locations (eg compare, and packed decimal instructions).
If you look down the '9' column you see all the 'C' (compare) instructions.
And then the '?A, ?B, ?C, and ?D' columns have add, subt, multiply, and divide instructions.
Store halfword and store are x'40' and x'50'
Load halfword and load are x'48 and x'58'
In addition to those, load register, load halfword, load, and load multiple are all in col-8.
The equivalent store instructions are all in col-0.
There are AND, OR, and EXCLUSIVE OR, instructions.
The easy way to think of them is:
AND turns bits off. (col-4)
OR turns bits on. (col-6)
EXCLUSIVE OR reverses bits. (col-7)
If you look across row-4, you'll see several half word instructions.
Just below that, in row-5, are similar full word instructions.
There are, of course, several instructions (eg EDit) that are individual and not in a set.
Floating point instructions work with floating point registers, and are not often used.
A?, B?, and C? instructions were not originally defined at all, and have since been used for new instructions.
I've shown most user op-codes in UPPER CASE (like BALR).
I put privileged (not user) instructions in lower case.
Although I have used many of these instructions, very few programs use more than about 30 of them,
and 80-90% of each program consists of less than about half of that.
The problem isn't what shape your blocks are (what they do) but rather how you put them together.
0 1 2 3 4 5 6 7 8 9 A B C D E F
0? spm BALR BCTR BCR ssk isk SVC BSM BASSM BASR MVCL CLCL
1? LPR LNR LTR LCR NR CLR OR XR LR CR AR SR MR DR ALR SLR
2? -- floating point --
3? -- floating point --
4? STH LA STC IC EX BAL BCT BC LH CH AH SH MH BAS CVD CVB
5? ST lae N CL O X L C A S M D AL SL
6? -- floating point --
7? -- floating point --
8? ssm lpsw diag wrd rdd BXH BXLE SRL SLL SRA SLA SRDL SLDL SRDA SLDA
9? STM TM MVI ts NI CLI OI XI LM sio tio hio tch
A? -- new extended (2-byte opcodes)
B? -- new extended CS CDS CLM STCM ICM
C? -- new extended
D? trtr MVN MVC MVZ NC CLC OC XC TR TRT ED EDMK
E? -- new extended (2-byte opcodes)
F? srp MVO PACK UNPK ZAP CP AP SP MP DP
SOME instruction descriptions (ie ones that are commonly used):
BALR #,# branch and link register- go to the 2nd location, save current addr in first register.
Can be used to set current address in first register.
BCTR #,# subt 1 from first reg, go to 2nd if first it not 0. (can be used to subtract 1)
BCR cond,# branch to second location, depending on the condition code.
SVC Supervisor call (do a system service, eg open or close files)
BSM Branch and set mask. (return from a called routine)
BASSM Branch and Save and set mask. (call a routine and save the system mask)
BASR Branch and save register (branch and save addr in extended address mode)
MVCL Move Character Long (move a gagillion bytes)
CLCL Compare Logical Character Long (compare a gagillion bytes)
LTR Load one register into another and set the condition code for + - or zero.
NR And register combine them leaving only bits that are on in both, still on.
OR Or register combine them leaving bits that were on in either still on.
XR Exclusive Or If both relative bits are the same (on or off) turn off. If different, turn on.
LR Load register set the first with what's in the second. (ALL instructions go right to left)
CR Compare
AR Add
SR Subtract
MR Multiply
DR Divide
STH Store low halfword in from a register
LA Load address loads an address, no memory involved, JUST calculates a number.
STC Store low byte in a register.
IC Insert Character loads one byte of memory into the low byte of a register. DOES NOT change high bytes.
EX OR the low byte of the specified register into byte-2 of an object instruction and run that instruction.
BAL Branch and Link, go to a routine, save current location.
BCT Branch on Count, Subt 1 from a register and branch if not 0. (load # of times you want to branch)
BC Branch on condition. eg branch equal, not equal, high, low, etc.
LH Load a halfword (2 bytes) and propogate the sigh to the high 2 bytes of the register.
CH Compare halfword compare 2 bytes.
AH Add halfword
SH Subtract halfword
MH Multiply halfword (used quite a lot)
CVD Convert to Decimal Convert a binary register to an 8 byte packed decimal field.
CVB Convert to Binary Convert an 8 byte packed decimal field to binary in a register.
to be worked on later.