Professional Documents
Culture Documents
R.P. Shannon
Programart Corporation
124 Mt. Auburn Street
Cambridge, MA 02138
(617)498-2948
shannon@programart.com
MVS Expo 98
Session I05
October 26-30, 1998
Atlanta, GA
1
Trademarks
IBM
MVS/ESA
OS/390
RACF
S/390
System/390
IBM
PC Types
Stacking PC: Uses the Linkage Stack
Basic PC: Does not use the linkage stack
Non-Space Switching PC:
l
l
l
Linkage Stack
A system-managed savearea
Populated by Stacking PCs and by BAKR instruction
PR to restore environment from stack and return to caller
Separate stack for each dispatchable unit
l 96 entries (default)
l
Contains:
l
l
l
Linkage Stack
CR 15
STCBLSDP
Entry Table:
An array of PC Routine definitions
Entry Table Entry:
Individual PC Routine definition
Entry Table Descriptor: Describes the array of PC Routines
Key
8
1 M W P A S C C
12
16
18
Prog
Mask
20
0 0 0 0 0 0 0 0
24
31
Instruction Address
63
10
ARR:
ASCMODE:
EK:
PARM1/2:
Routine
STATE:
11
ETE
Parm2
At entry to PC Routine:
R4
Parm1
Parm2
13
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET Real Addr
Flag
ET
ET
LENET
LENET
LENET
LENET
LENET
LENET
LENET
LENET
LEN
LEN
14
Address Space
Linkage Tables
Entry Tables
15
AASF
GRS
Display allocations table manager
Miscellaneous MVS Services
WTO services
System trace services
Virtual fetch
SMF buffering
LLA
Data space PC services
VLF
Reserved
Reserved for DFP
Reserved
LLA Copy
SDOM Services
MVS Message Services
OE Services
WLM
16
ASCBASTE:
ASCBLTOV:
ASCBATOV
ASCBETC:
ASCBETCN:
ASCBLXR:
ASCBAXR:
17
PCSAMP
Sample program to illustrate the functions required to use
PC Routines:
l
l
l
l
l
l
l
19
*
*
*
+---------------------------------------------+
+ Reserve a non-system linkage index
+
+---------------------------------------------+
MVC
#_LX_ENTRIES,=F1
request a single lx
LXRES LXLIST=LX_PARMLIST,SYSTEM=NO,MF=(E,LXRES_LF)
LTR
R15,R15
work ok?
BNZ
ERRRTN_LXRES
bif no
*
*
*
+---------------------------------------------+
+ Define an Entry Table
+
+---------------------------------------------+
MVC
ETDEF
LTR
BNZ
20
10
+---------------------------------------------+
+ Define the Entry Table Entries
+
+---------------------------------------------+
L
R2,TPRT_ADDR
get addr of tprot routine
ETDEF TYPE=SET,ETEADR=ETD_TPROT,ROUTINE=(2),
PC=STACKING,ASCMODE=PRIMARY,SSWITCH=NO,SASN=OLD,
STATE=SUPERVISOR,RAMODE=31,AKM=(0:15),EK=(0)
LTR
R15,R15
work ok?
BNZ
ERRRTN_ETD
bif no
L
R2,FRLX_ADDR
get addr of freelx routine
ETDEF TYPE=SET,ETEADR=ETD_FRLX,ROUTINE=(2),
PC=STACKING,ASCMODE=PRIMARY,SSWITCH=NO,SASN=OLD,
STATE=SUPERVISOR,RAMODE=31,AKM=(0:15)
LTR
R15,R15
work ok?
BNZ
ERRRTN_ETD
bif
*
*
*
X
X
X
X
+---------------------------------------------+
+ Build Entry Table Discriptor
+
+---------------------------------------------+
ETCRE ENTRIES=ENTRY_TABLE
define entry table
LTR
R15,R15
work ok?
BNZ
ERRRTN_ETCRE
bif no
ST
R0,ET_TOKEN
else save the token
21
x
x
22
11
R1,R2
R14,LX_NUMBER
TPROT_PC(14)
C
BH
CLEANUP
R15,=F4
NO_REFERENCE
FRLX_PC(14)
DS
PC
0H
23
DS
LA
B
TPROT_4 DS
LA
B
TPROT_8 DS
LA
B
TPROT_16 DS
LA
B
R11,0
*,R11
R2
0(R3),0(R2)
8,TPROT_0
4,TPROT_4
2,TPROT_8
1,TPROT_16
0H
R15,0
TPROTXIT
0H
R15,0
TPROTXIT
0H
R15,0
TPROTXIT
0H
R15,0
TPROTXIT
TPROTXIT DS
0H
EREG R1,R1
PR
set rc to zero
out out
set rc to zero
out out
set rc to zero
out out
set rc to zero
out out
restore callers R1
boogie
24
12
DS 0D
FREELX
inline pc routine
+----------------------------------------------+
+ PC Routine to Free Linkage Index
+
+ R13 ---> workarea
+
+----------------------------------------------+
BASR R11,0
determine where we are
USING *,R11
establish base register
LR
R10,R13
copy workarea addr into reg 10
USING WORKAREA,R10
map workarea
ETDIS TKLIST=ET_TOKEN_LIST
XC
LXFRE_LF(LXFRE_LEN),LXFRE_LF
clear workarea
LXFRE LXLIST=LX_PARMLIST,MF=(E,LXFRE_LF) free lx
XC
LX_NUMBER,LX_NUMBER
clear lx number
EREG
PR
R1,R1
25
TPRT_ADDR DC AL4(TPROTRTN)
FRLX_ADDR DC AL4(FREELX)
26
13
DSECT
EQU
EQU
DS
0
1
18F
pc routine 0
pc routine 1
savearea
ENTRY_TABLE
ETD_HEADER
ETD_TPROT
ETD_FRLX
ETD_PARMLEN
DS
DS
DS
DS
EQU
0D
XL(ETDLEN)
XL(ETDELEN)
XL(ETDELEN)
*-ENTRY_TABLE
entry table
header
1st entry
2nd entry
length
LX_PARMLIST
#_LX_ENTRIES
LX_NUMBER
DS
DS
DS
0F
F
F
lx parmlist
# of lxs
lx number (returned)
ET_TOKEN_LIST DS
#_ET_TOKENS
DS
ET_TOKEN
DS
0F
F
F
LXRES_LF
LXFRE_LF
LXFRE_LEN
ETCON_LF
LXRES
LXRES
EQU
ETCON
MF=L
MF=L
*-LXFRE_LF
MF=L
WALEN
EQU *-WORKAREA
IHAETD FORMAT=1
27
1 per system
Unreliable - Do Not Use!
SSCT:
l
l
28
14
Upon entry:
l
l
30
15
Bibliography
OS/390 V2R6.0 MVS Auth Assm Services Reference
ENF-IXG, GC28-1765, IBM Corporation
OS/390 V2R6.0 MVS Auth Assm Services Reference
LLA-SDU, GC28-1766, IBM Corporation
OS/390 V2R6.0 MVS Extended Addressability Guide, GC28-1769, IBM
Corporation
A Detailed Look at ESA/370; Brian Moore; IBM Corporation
Concepts of Enterprise Systems Architecture/370; K.E. Plambeck; IBM
Systems Journal Volume 28, Number 1, 1988
Developing an MVS/ESA Cross Memory Application USing ESA/370
Advanced Address Space Facilities; Keefe Hayes; SAS Institute; SHARE
76, Session O320; 27 February, 1991
Enterprise Systems Architecture/390; Jeff Frye; IBM Corporation;
ESA/390 Principles of Operation, Doug Smucker, Amdahl Corporation,
Session O355, SHARE 77
MVS/ESA Linkage Stack Save Program Status, Edward Williams,
Candle Report Volume 13, Number 5, May 1991
Bit Bucket X0D, Bob Shannon and Carl Youngren, SHARE 88
32
16