Zseries Assembler S8172a
Zseries Assembler S8172a
Zseries Assembler S8172a
John R. Ehrman
ehrman@us.ibm.com or ehrman@vnet.ibm.com
Table of Contents
Contents-1
Presentation Topics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Freeway Architecture . . . . . . . . . . . . . . . . . . . . . . . . . .
Freeway Architecture Overview . . . . . . . . . . . . . . . . .
Architecture Overview: z/Arch Program Status Word . . .
Architecture Overview: 64-Bit Addressing . . . . . . . . . . .
Architecture Overview: 64-Bit Virtual Address Translation
Architecture Overview: Registers . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 8
. 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
..
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
2
3
4
5
6
7
Table of Contents
Modal Instructions and Addressing Modes . . . . . . . . .
Modal Instructions that Depend on Addressing Mode
Trimodal Addressing and Mode Switching . . . . . . . .
Mode-Switching Branch Instructions . . . . . . . . . . . .
Entry Points and Entry Addresses . . . . . . . . . . . . . .
Contents-2
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
25
26
27
29
30
Presentation Topics
Dual-mode architecture
Addressing modes
Modal instructions
The IBM eserver zSeries brand consists of the established IBM e-business logo with the descriptive term server
following it. z/Architecture, zSeries, z/OS, and z/VM are trademarks of IBM.
Freeway Architecture
PSW
Addressing
Registers
31 33
63
I 64 bits H
64
127
:
:
:
:
16 billion
GB
:
:
:
:
////////////
2 GB
16 MB
64 bits
32 bits
31 bits
24 bits
/ segment page
byte
I 31 bit address H
I 64 bit address H
Old ESA/390 instructions use only the right halves (left halves are invisible)
You can use 64-bit registers without being in 64-bit addressing mode!
I 64bit register H z/Arch mode
I 32bit register H ESA/390 mode
GR0
GR1
:
:
GR15
0
31 32
63
Right half (old 32-bit part) now numbered 32-63, or {0-31} for ESA/390 mode
All instructions in
22 Instr'ns
141 Instructions
usable only in
Many old instructions don't affect bits 0-31 of the 64-bit register
Instructions usable in both addressing modes:
10
Number
z/Arch-Only
General
140
119
21
Floating Point
12
12
Control
11
10
Total
163
141
22
Details at slide 20
11
2,XYZ
2,7
Mnemonics for ops that mix 32- and 64-bit operands to give a 64-bit
result have GF or GH (and in a few cases, GT or GC)
AGF 2,PQR
AGFR 2,7
AGLFR 2,7
12
ESA/390 Ops
LR, LTR
LGR, LTGR
LGFR, LTGFR
AR, SR
AGR, SGR
AGFR, SGFR
ALR, SLR
ALGR, SLGR
ALGFR, SLGFR
CR, CLR
CGR, CLGR
CGFR, CLGFR
NR, OR, XR
BCTR
BCTGR
13
L, LH, ST
LG, STG
LGF, LGH
A, S, C
AG, SG, CG
AL, SL, CL
N, O, X
NG, OG, XG
MS, MSR
MSG, MSGR
BCT
BCTG
CVD, CVB
CVDG, CVBG
MSGF, MSGFR
No mixed 16/64 analogs of other halfword ops (AH, CH, MH, SH)
14
Comments
BXH, BXLE
BXHG, BXLEG
LM, STM
LMG, STMG
LMD, LMH, STMH
Comments
CS, CDS
CSG, CDSG
15
ESA/390 Ops
z/Arch Ops
Comments
TMH, TML
TMHH, TMHL
BRCT
BRCTG
LHI, AHI,
MHI, CHI
LGHI, AGHI,
MGHI, CGHI
BRC
BRCL*
BRAS
BRASL*
LARL*
16
z/Arch Ops
Comments
LLGF, LLGFR
LLGT, LLGTR
LLGH
LLGC
LLGT, LLGTR: lets you set a 64-bit address from a 31-bit address, without
having to worry about the high-order bit
LLGC: like Insert Character, but no need to clear the target register
17
z/Arch Ops
Comments
DSG, DSGR
DSGF, DSGFR
DL*, DLR*
DLG, DLGR
ML*, MLR*
MLG, MLGR
ALC*, ALCR*
ALCG, ALCGR
SLB*, SLBR*
SLBG, SLBGR
18
Comments
HL
LH
LL
19
Byte-Reversing Load/Store
z/Arch Ops
Comments
LRVH*, STRVH*
20
Operation
Integer to Hex
Integer to IEEE
Hex to Integer
IEEE to Integer
21
z/Arch Ops
Comments
LPQ, STPQ
TAM*
EPSW
Control instructions:
22
Quadword Alignment
23
Need quadword alignment for LPQ, STPQ, CDSG, some PLO operands
QWORK
Quad1
Quad2
DSect
DS
DS
QPad
DS
LQWORK Equ
2D
2D
D
*QWORK
AHI R2,X'0008'
NILL R2,X'FFF0'
USING QWORK,R2
24
AND, OR, INSERT IMMEDIATE: NIHH, NIHL, OIHH, OIHL, IIHH, IIHL
25
26
Branch instructions:
Translate instructions:
TRE, TRT
String operations:
27
28
Test Addressing Mode: TAM* sets CC per PSW's EB bits (see slide 4)
*
29
I 64bit GPR H
0
3132
63
In all modes, BASSM and BSM change addressing mode based on bits
63 and 32 of GPRR2
Bit
63
32
0
0
1
0
1
x
AMODE changed to
24
31
64
30
NILL EntryReg,X'FFFE'
USING EntryPoint,EntryReg
TMLL EntryReg,1
Follow with a relative (not based!) conditional branch
Freeway Programming Overview
31
32
Binary constants
FD
DC
FD'95'
DC
AD(95)
33
OPTABLE(ESA) option may help avoid macro conflicts with new mnemonics
(Or, use macros with names longer than 5 characters)
ANY31, 64
RMODE
31, 64
34
Summary
Summary
35
New architecture
Upward compatibility
References
36