360 Assembly/360 Instructions

From Wikibooks, open books for an open world
Jump to: navigation, search

There are several types of instructions on the 360 mainframe. The instruction type is determined by the first two bits of the op code. The instruction types are

  • RR Instructions which use 2 registers for the arguments. These are two bytes long. RR instructions are op codes where the two high bits of the op code are 00, e.g. instructions 00-3F.
  • RX Instructions which use one register and combined register and address as a base-displacement address. These are 4 bytes long. RX instructions are op codes where the two high bits of the op code are 01, e.g. instructions 40-7F.
  • RS Instructions which use one register and combined register and address as a base-displacement address to reference a single string. These are 4 bytes long. RS instructions are op codes where the two high bits of the op code are 10, e.g. instructions 80-BF.
  • SS Instructions which use two combined register and address values as base-displacement addresses to reference two strings. These are also 6 bytes long. SS instructions are op codes where the two high bits of the op code are 11, e.g. instructions CF-FF.

All instructions must be aligned to an even address. Attempts to create an instruction at an odd address will be flagged as an error by the assembler; an attempt to branch to an odd address will result in a program check.

There are three classes of instructions. 360 instructions are those which were part of the original IBM 360 mainframe instruction set, they are shown on the table below in this color: [       ]. 370 instructions were added with the creation of the IBM 370, they are shown on the table below in this color: [       ] are only available on 370 and higher series machines, and will cause a program check if they are attempted to be executed on a 360. z/System instructions were created after the 370, they are shown on the table below in this color: [       ] and will not work on 360 or 370 hardware, only on z/System machines.

In general, there are seven types of instructions:

The table shown below can be sorted on any of its columns by clicking on the symbol at the top of that column.

Opcode
(Hex)

Mnemonic

Description
Type of
Instruction
Class of
Instruction
0101 PR Program Return RR
0102 UPT Update Tree RR
0107 SCKPF Set Clock Programmable Field RR
010B TAM Test Addressing Mode RR
010C SAM24 Set Addressing Mode (to 24 bits) RR
010D SAM31 Set Addressing Mode (to 31 bits) RR
010E SAM64 Set Addressing Mode (to 64 bits) RR
01FF TRAP2 Trap RR
04 SPM Set Program Mask RR Other Instructions  
05 BALR Branch And Load Register RR Branch Instructions  
06 BCTR Branch on CounT Register RR Branch Instructions  
07 BCR Branch on Condition Register RR Branch Instructions  
070 NOPR No Operation Register RR Branch Instructions  
07F BR Branch Register (Unconditional) RR Branch Instructions  
08 SSK Set Storage Key RR 360 Only Other Instructions  
09 ISK Insert Storage Key RR 360 Only Other Instructions  
0A SVC SuperVisor Call Immediate Control Flow Instructions  
0B BSM Branch and Set Mode RR
0C BASSM Branch and Save and Set Mode RR
0D BASR Branch And Store Register RR Branch Instructions  
0E MVCL MoVe Character Long RR
0F CLCL Compare Logical Character Long RR
10 LPR Load Positive RR Data Transfer Instructions  
11 LNR Load Negative RR Data Transfer Instructions  
12 LTR Load and Test Register RR Data Transfer Instructions  
13 LCR Load and Compare Register RR Data Transfer Instructions  
14 NR aNd Register RR Data Transfer Instructions  
15 CLR Compare Logical Register RR Logic Instructions  
16 OR Or Register RR Data Transfer Instructions  
17 XR eXclusive-or Register RR Data Transfer Instructions  
18 LR Load Register RR Data Transfer Instructions  
19 CR Compare Register RR Logic Instructions  
1A AR Add Register RR Arithmetic Instructions  
1B SR Subtract Register RR Arithmetic Instructions  
1C MR Multiply Register RR Arithmetic Instructions  
1D DR Divide Register RR Arithmetic Instructions  
1E ALR Add Logical Register RR Arithmetic Instructions  
1F SLR Subtract Logical Register RR Arithmetic Instructions  
20 LPDR Load Positive RR Data Transfer Instructions  
21 LNDR Load Negative RR Data Transfer Instructions  
22 LTDR Load and Test RR Data Transfer Instructions  
23 LCDR Load Complement RR Data Transfer Instructions  
24 HDR Halve RR Arithmetic Instructions  
25 LDXR Load Double eXt. Rounded RR
25 LRDR Load Rounded RR 360 Only  
26 MXR Multiply RR Arithmetic Instructions  
27 MXDR Multiply RR Arithmetic Instructions  
28 LDR Load RR Data Transfer Instructions  
29 CDR Compare Double Reg. RR Data Transfer Instructions  
2A ADR Add Double Register RR Arithmetic Instructions  
2B SDR Subtract Double Reg. RR Arithmetic Instructions  
2C MDR Multiply Double Reg. RR Arithmetic Instructions  
2D DDR Divide Double Reg. RR Arithmetic Instructions  
2E AWR Add Unnormalized RR Arithmetic Instructions  
2F SWR Subtract Unnormalized RR Arithmetic Instructions  
30 LPER Load Positive RR Data Transfer Instructions  
31 LNER Load Negative RR Data Transfer Instructions  
32 LTER Load and Test RR Data Transfer Instructions  
33 LCER Load Complement RR Data Transfer Instructions  
34 HER Halve RR Arithmetic Instructions  
35 LEDR RR
35 LRER Load Rounded RR Data Transfer Instructions  
36 AXR Add Normalized RR Arithmetic Instructions  
37 SXR Subtract Normalized RR Arithmetic Instructions  
38 LER Load RR Data Transfer Instructions  
39 CER Compare RR Logic Instructions  
3A AER Add Normalized RR Arithmetic Instructions  
3B SER Subtract Normalized RR Arithmetic Instructions  
3C MER Multiply Normalized RR Arithmetic Instructions  
3C MDER RR Arithmetic Instructions  
3D DER Divide Normalized RR Arithmetic Instructions  
3E AUR Add Unnormalized RR Arithmetic Instructions  
3F SUR Subtract Unnormalized RR Arithmetic Instructions  
40 STH STore Halfword RX Data Transfer Instructions  
41 LA Load Address RX Data Transfer Instructions  
42 STC STore Character RX Data Transfer Instructions  
43 IC Insert Character RX Data Transfer Instructions  
44 EX EXecute RX Data Transfer Instructions  
45 BAL Branch And Link RX Branch Instructions  
46 BCT Branch on CounT RX Branch Instructions  
47 BC Branch on Condition RX Branch Instructions  
470 NOP No Operation RX Branch Instructions  
471 BO Branch on Overflow/Ones RX Branch Instructions  
472 BH Branch (a High) RX Branch Instructions  
472 BP Branch on Plus RX Branch Instructions  
474 BL Branch (a Low) RX Branch Instructions  
474 BM Branch on Minus/Mixed RX Branch Instructions  
477 BNE Branch Not Equal RX Branch Instructions  
477 BNZ Branch Not Zero RX Branch Instructions  
478 BE Branch (a Equal b) RX Branch Instructions  
478 BZ Branch on Zero RX Branch Instructions  
47B BNL Branch (a Not Low) RX Branch Instructions  
47B BNM Branch Not Minus RX Branch Instructions  
47D BNH Branch Not High RX Branch Instructions  
47D BNP Branch Not Plus RX Branch Instructions  
47E BNO Branch Not Ones RX Branch Instructions  
47F B Branch (unconditional) RX Branch Instructions  
48 LH Load Halfword RX Data Transfer Instructions  
49 CH Compare Halfword RX Logic Instructions  
4A AH Add Halfword RX Arithmetic Instructions  
4B SH Subtract Halfword RX Arithmetic Instructions  
4C MH Multiply Halfword RX Arithmetic Instructions  
4D BAS Branch And Store RX Branch Instructions  
4E CVD ConVert to Decimal RX Data Transfer Instructions  
4F CVB ConVert to Binary RX Data Transfer Instructions  
50 ST STore RX Data Transfer Instructions  
51 LAE
54 N aNd RX Data Transfer Instructions  
55 CL Compare Logical RX Logic Instructions  
56 O Or RX Data Transfer Instructions  
57 X eXclusive or RX Data Transfer Instructions  
58 L Load RX Data Transfer Instructions  
59 C Compare RX Logic Instructions  
5A A Add RX Arithmetic Instructions  
5B S Subtract RX Arithmetic Instructions  
5C M Multiply RX Arithmetic Instructions  
5D D Divide RX Arithmetic Instructions  
5E AL Add Logical RX Arithmetic Instructions  
5F SL Subtract Logical RX Arithmetic Instructions  
60 STD Store Double RX Data Transfer Instructions  
67 MXD Multiply Double RX Arithmetic Instructions  
68 LD Load Double RX Data Transfer Instructions  
69 CD Compare Double RX Logic Instructions  
6A AD Add Double RX Arithmetic Instructions  
6B SD Subtract Double RX Arithmetic Instructions  
6C MD Multiply Double RX Arithmetic Instructions  
6D DD Divide Double RX Arithmetic Instructions  
6E AW Add unnormalized (Word) RX Arithmetic Instructions  
6F SW Subtract unnormalized (Word) RX Arithmetic Instructions  
70 STE Store short RX Data Transfer Instructions  
71 MS RX
78 LE Load short RX Data Transfer Instructions  
79 CE Compare short RX Logic Instructions  
7A AE Add normalized short RX Arithmetic Instructions  
7B SE Subtract normalized short RX Arithmetic Instructions  
7C ME Multiply short RX Arithmetic Instructions  
7C MDE RX
7D DE Divide short RX Arithmetic Instructions  
7E AU Add Unnormalized short RX Arithmetic Instructions  
7F SU Subtract Unnormalized short RX Arithmetic Instructions  
80 SSM Set System Mask RX Other Instructions  
82 LPSW Load Program Status Word RX Data Transfer Instructions  
83 Diagnose Diagnose RX Other Instructions  
84 WRD Write Direct RX 360 Only Other Instructions  
84 BRXH Branch Register on indeX High
85 RDD Read Direct RX 360 Only Other Instructions  
85 BRXLE Branch Register on indeX Low or Equal
86 BXH Branch on indeX High RS Branch Instructions  
87 BXLE Branch on indeX Low or Equal RS Branch Instructions  
88 SRL Shift Right Logical RX Shift and Rotate Instructions  
89 SLL Shift Left Logical RX Shift and Rotate Instructions  
8A SRA Shift Right Arithmetic RX Shift and Rotate Instructions  
8B SLA Shift Left Arithmetic RX Shift and Rotate Instructions  
8C SRDL Shift Right Double Logical RX Arithmetic Instructions  
8D SLDL Shift Left Double Logical RX Arithmetic Instructions  
8E SRDA Shift Right Double Arithmetic RX Shift and Rotate Instructions  
8F SLDA Shift Left Double Arithmetic RX Shift and Rotate Instructions  
90 STM STore Multiple RX Data Transfer Instructions  
91 TM Test under Mask RX Logic Instructions  
92 MVI MoVe Immediate RX Data Transfer Instructions  
93 TS Test and Set RX Logic Instructions  
94 NI aNd Immediate RX Data Transfer Instructions  
95 CLI Compare Logical Immediate RX Logic Instructions  
96 OI Or Immediate RX Arithmetic Instructions  
97 XI eXclusive-or Immediate RX Data Transfer Instructions  
98 LM Load Multiple RS Data Transfer Instructions  
99 TRACE
9A LAM
9B STAM
9D TIO Test I/O SI Other Instructions  
9F TCH Test CHannel SI Other Instructions  
A50 IIHH
A51 IIHL
A52 IILH
A53 IILL
A54 NIHH
A55 NIHL
A56 NILH
A57 NILL
A58 OIHH
A59 OIHL
A5A OILH
A5B OILL
A5C LLIHH
A5D LLIHL
A5E LLILH
A5F LLILL
A70 TMLH
A70 TMH
A71 TMLL
A71 TML
A72 TMHH
A73 TMHL
A74 BRC
A75 BRAS
A76 BRCT
A77 BRCTG
A78 LHI
A79 LGHI
A7A AHI
A7B AGHI
A7C MHI
A7D MGHI
A7E CHI
A7F CGHI
A8 MVCLE
A9 CLCLE
AC STNSM
AD STOSM
AE SIGP
AF MC
B1 LRA
B202 STIDP
B204 SCK
B205 STCK
B206 SCKC
B207 STCKC
B208 SPT
B209 STPT
B20A SPKA
B20B IPK
B20D PTLB
B210 SPX
B211 STPX
B212 STAP
B214 SIE
B218 PC
B219 SAC
B21A CFC
B221 IPTE
B222 IPM
B223 IVSK
B224 IAC
B225 SSAR
B226 EPAR
B227 ESAR
B228 PT
B229 ISKE
B22A RRBE
B22B SSKE
B22C TB
B22D DXR
B22E PGIN
B22F PGOUT
B230 CSCH
B231 HSCH
B232 MSCH
B233 SSCH
B234 STSCH
B235 TSCH
B236 TPI
B237 SAL
B238 RSCH
B239 STCRW
B23A STCPS
B23B RCHP
B23C SCHM
B240 BAKR
B241 CKSM
B244 SQDR
B245 SQER
B246 STURA
B247 MSTA
B248 PALB
B249 EREG
B24A ESTA
B24B LURA
B24C TAR
B24D CPYA
B24E SAR
B24F EAR
B250 CSP
B252 MSR
B254 MVPG
B255 MVST
B257 CUSE
B258 BSG
B25A BSA
B25D CLST
B25E SRST
B263 CMPSC
B276 XSCH
B277 RP
B278 STCKE
B279 SACF
B27D STSI
B299 SRNM
B29C STFPC
B29D LFPC
B2A5 TRE
B2A6 CUUTF
B2A7 CUTFU
B2B1 STFL
B2B2 LPSWE
B2FF TRAP4
B300 LPEBR
B301 LNEBR
B302 LTEBR
B303 LCEBR
B304 LDEBR
B305 LXDBR
B306 LXEBR
B307 MXDBR
B308 KEBR
B309 CEBR
B30A AEBR
B30B SEBR
B30C MDEBR
B30D DEBR
B30E MAEBR
B30F MSEBR
B310 LPDBR
B311 LNDBR
B312 LTDBR
B313 LCDBR
B314 SQEBR
B315 SQDBR
B316 SQXBR
B317 MEEBR
B318 KDBR
B319 CDBR
B31A ADBR
B31B SDBR
B31C MDBR
B31D DDBR
B31E MADBR
B31F MSDBR
B324 LDER
B325 LXDR
B326 LXER
B336 SQXR
B337 MEER
B340 LPXBR
B341 LNXBR
B342 LTXBR
B343 LCXBR
B344 LEDBR
B345 LDXBR
B346 LEXBR
B347 FIXBR
B348 KXBR
B349 CXBR
B34A AXBR
B34B SXBR
B34C MXBR
B34D DXBR
B350 TBEDR
B351 TBDR
B353 DIEBR
B357 FIEBR
B358 THDER
B359 THDR
B35B DIDBR
B35F FIDBR
B360 LPXR
B361 LNXR
B362 LTXR
B363 LCXR
B365 LXR
B366 LEXR
B367 FIXR
B369 CXR
B374 LZER
B375 LZDR
B376 LZXR
B377 FIER
B37F FIDR
B384 SFPC
B38C EFPC
B394 CEFBR
B395 CDFBR
B396 CXFBR
B398 CFEBR
B399 CFDBR
B39A CFXBR
B3A4 CEGBR
B3A5 CDGBR
B3A6 CXGBR
B3A8 CGEBR
B3A9 CGDBR
B3AA CGXBR
B3B4 CEFR
B3B5 CDFR
B3B6 CXFR
B3B8 CFER
B3B9 CFDR
B3BA CFXR
B3C4 CEGR
B3C5 CDGR
B3C6 CXGR
B3C8 CGER
B3C9 CGDR
B3CA CGXR
B6 STCTL
B7 LCTL
B8 LMC Load Multiple Control RS P Other Instructions  
B900 LPGR
B901 LNGR
B902 LTGR
B903 LCGR
B904 LGR
B905 LURAG
B908 AGR
B909 SGR
B90A ALGR
B90B SLGR
B90C MSGR
B90D DSGR
B90E EREGG
B90F LRVGR
B910 LPGFR
B911 LNGFR
B912 LTGFR
B913 LCGFR
B914 LLGFR
B916 LCGR
B917 LLGTR
B918 AGFR
B919 SGFR
B91A ALGFR
B91B SLGFR
B91C MSGFR
B91D DSGFR
B91F LRVR
B920 CGR
B921 CLGR
B925 STURG
B930 CGFR
B931 CLGFR
B946 BCTGR
B980 NGR
B981 OGR
B982 XGR
B986 MLGR
B987 DLGR
B988 ALCGR
B989 SLBGR
B98D EPSW
B990 TRTT
B991 TRTO
B992 TROT
B993 TROO
B996 MLR
B997 DLR
B998 ALCR
B999 SLBR
B99D ESEA
BA CS
BB CDS
BD CLM
BE STCM Store Characters under Mask
BF ICM Insert Characters under Mask
C00 LARL
C04 BRCL
C05 BRASL
D1 MVN MoVe Numerio SS Data Transfer Instructions  
D2 MVC MoVe Character SS Data Transfer Instructions  
D2 MVZ MoVe Zoned SS Data Transfer Instructions  
D4 NC aNd Character SS Data Transfer Instructions  
D5 CLC Compare Logical Character SS Logic Instructions  
D6 OC Or Character SS Data Transfer Instructions  
D7 XC eXclusive-or Character SS Data Transfer Instructions  
D9 MVCK
DA MVCP
DB MVCS
DC TR TRanslate SS Data Transfer Instructions  
DD TRT TRanslate and Test SS Data Transfer Instructions  
DE ED EDit SS Data Transfer Instructions  
DF EDMK EDit and MarK SS Data Transfer Instructions  
E1 PKU
E2 UNPKU
E303 LRAG
E304 LG
E308 AG
E309 SG
E30A ALG
E30B SLG
E30C MSG
E30D DSG
E30E CVBG
E30F LRVG
E314 LGF
E315 LGH
E316 LLGF
E317 LLGT
E318 AGF
E319 SGF
E31A ALGF
E31B SLGF
E31C MSGF
E31D DSGF
E31E LRV
E31F LRVH
E320 CG
E321 CLG
E324 STG
E32E CVDG
E32F STRVG
E330 CGF
E331 CLGF
E33E STRV
E33F STRVH
E346 BCTG
E380 NG
E381 OG
E382 XG
E386 MLG
E387 DLG
E388 ALCG
E389 SLBG
E38E STPQ
E38F LPQ
E390 LLGC
E391 LLGH
E396 ML
E397 DL
E398 ALC
E399 SLB
E500 LASP
E501 TPROT
E502 STRAG
E50E MVCSK
E50F MVCDK
E8 MVCIN
E9 PKA
EA UNPKA
EB04 LMG
EB0A SRAG
EB0B SLAG
EB0C SRLG
EB0D SLLG
EB0F TRACG
EB1C RLLG
EB1D RLL
EB20 CLMH
EB24 STMG
EB25 STCTG
EB26 STMH
EB2C STCMH
EB2F LCTLG
EB30 CSG
EB3E CDSG
EB44 BXHG
EB45 BXLEG
EB80 ICMH
EB8E MVCLU
EB8F CLCLU
EB96 LMH
EBC0 TP
EC44 BRXHG
EC45 BRXLG
ED04 LDEB
ED05 LXDB
ED06 LXEB
ED07 MXDB
ED08 KEB
ED09 CEB
ED0A AEB
ED0B SEB
ED0C MDEB
ED0D DEB
ED0E MAEB
ED0F MSEB
ED10 TCEB
ED11 TCDB
ED12 TCXB
ED14 SQEB
ED15 SQDB
ED17 MEEB
ED18 KDB
ED19 CDB
ED1A ADB
ED1B SDB
ED1C MDB
ED1D DDB
ED1E MADB
ED1F MSDB
ED24 LDE
ED25 LXD
ED26 LXE
ED34 SQE
ED35 SQD
ED37 MEE
EE PLO
EF LMD
F0 SRP Shift and Round Packed SS Arithmetic Instruction
F1 MVO Move with Offset SS Arithmetic Instruction
F2 PACK PACK SS Arithmetic Instruction
F3 UNPK UNPacK SS Arithmetic Instruction
F8 ZAP Zero and Add Packed SS Arithmetic Instruction
F9 CP Compare Packed SS Arithmetic Instruction
FA AP Add Packed SS Arithmetic Instruction
FB SP Subtract Packed SS Arithmetic Instruction
FC MP Multiply Packed SS Arithmetic Instruction
FD DP Divide Packed SS Arithmetic Instruction


360 Assembly Language
360 Family Introduction · Basic FAQ · 360 Family · 360 Architecture · Comments
360 Instruction Set 360 Instructions · Branch Instructions · Data Transfer Instructions · Control Flow Instructions · Arithmetic Instructions · Logic Instructions · Shift and Rotate Instructions · Other Instructions
Syntaxes and Assemblers 360 Assemblers· Pseudo Instructions
Instruction Extensions Floating Point · High-Level Languages
Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox
Sister projects
Print/export