
31-bit Addressing Problem
I am attempting to upgrade some existing subroutines to 31-bit
addressing, so that programs which call them aren't restricted to 24-bit
addressing.
I thought I understood the requirements, but after compiling the COBOL
programs and assembling the ALC, I _sometimes_ get addressing
exceptions. Naturally, it's never when I test, but only after I install
in production!
The following Assembler subroutine, used to enqueue a data set that is
shared among many users while a record is written to it, is one that has
caused problems. A caller running AMODE 31, RMODE ANY, and loaded above
the 16M line statically calls the "Enqueue Manager", and the code
fails. When I look at the PSW, bit 32 is ON, so that word 2 of the PSW
is X'8xxxxxxx'. The address in Register 15 is that of ZENQMGR, and the
instruction that fails is the branch around the 'module id' assembled
into the program by the SAVE macro.
Does someone know what I'm forgetting to do correctly?
Here is a portion of the Assembler listing:
(I hope you can read it; my browser let me put it in with a fixed font
from a 3270 Mod 5 emulator.)
ZENQMGR MVS/ESA: GENERAL ENQUEUE/DEQUEUE MANAGEMENT
ROUTINE Page 3
Active Usings: None
Loc Object Code Addr1 Addr2 Stmt Source
Statement HLASM R2.0 1999/02/01 09.21
2 *AUTHOR. COLIN
CAMPBELL 00020000
3 * PRINT
NOGEN 00030001
000000 4 ZENQMGR
CSECT 00040000
5 ZENQMGR AMODE
31 00050000
6 ZENQMGR RMODE
ANY 00060000
7 ENQ CSAVE
R12,RETCODE 00070000
8+***********************************************************************
9+* CSAVE MACRO - COMPLETE
TRANSFER AND RETURN OF CONTROL LOGIC *
10+* OPTIONS - CREATE SYMBOLIC
REGISTERS, SET BASE REGISTER, *
11+* PLACE RETURN
CODE IN REG 15 FROM A HALF- OR FULLWORD, *
12+* AND GENERATE OR
SUPPRESS A NEW SAVE AREA. *
13+* NOTE - ALWAYS USE IN
CONJUNCTION WITH 'EXIT' MACRO. *
14+***********************************************************************
00000 15+R0 EQU
0 02-REGS
00001 16+R1 EQU
1 02-REGS
00002 17+R2 EQU
2 02-REGS
00003 18+R3 EQU
3 02-REGS
00004 19+R4 EQU
4 02-REGS
00005 20+R5 EQU
5 02-REGS
00006 21+R6 EQU
6 02-REGS
00007 22+R7 EQU
7 02-REGS
00008 23+R8 EQU
8 02-REGS
00009 24+R9 EQU
9 02-REGS
0000A 25+R10 EQU
10 02-REGS
0000B 26+R11 EQU
11 02-REGS
0000C 27+R12 EQU
12 02-REGS
0000D 28+R13 EQU
13 02-REGS
0000E 29+R14 EQU
14 02-REGS
0000F 30+R15 EQU
15 02-REGS
000000 47F0 F00C 0000C 31+ENQ B
12(0,15) BRANCH AROUND ID 02-SAVE
000004 07 32+ DC
AL1(7) LENGTH OF IDENTIFIER 02-SAVE
000005 E9C5D5D8D4C7D9 33+ DC
CL7'ZENQMGR' IDENTIFIER 02-SAVE
00000C 90EC D00C 0000C 34+ STM
14,12,12(13) SAVE REGISTERS 02-SAVE
000010 18CF 35+ LR R12,15 SET
BASE REGISTER 01-CSAVE
R:C 00000 36+ USING
ZENQMGR,R12 01-CSAVE
000012 47F0 C074 00074 37+ B
B0001 01-CSAVE
000016 58D0 C030 00030 38+ L
13,A0001+4 01-CSAVE
00001A 48F0 C194 00194 39+ LH
15,RETCODE X01-CSAVE
+ SET
RETURN CODE
00001E 58E0 D00C 0000C 40+ L
000022 980C D014 00014 41+ LM
0,12,20(13) RESTORE THE REGISTERS 02-RETUR
000026 9601 D00F 0000F 42+ OI
15(13),X'01' SET RETURN INDICATION 02-RETUR
00002A 07FE 43+ BR
14 RETURN 02-RETUR
00002C 0000000000000000 44+A0001 DC 18F'0' DEFINE
SAVE AREA 01-CSAVE
000074 50D0 C030 00030 45+B0001 ST
13,A0001+4 01-CSAVE
000078 18ED 46+ LR
14,13 01-CSAVE
00007A 41D0 C02C 0002C 47+ LA 13,A0001 CHAIN
SAVE AREAS 01-CSAVE
00007E 50DE 0008 00008 48+ ST
13,8(14) 01-CSAVE
000082 1BFF 49 SR
R15,R15 00080000
000084 40F0 C194 00194 50 STH
R15,RETCODE 00090000
CSAVE and its companion macros EP (Entry Point) and EXIT are in-house
developed code. (CSAVE can be told to generate reentrant code, and to
skip generation of a Save Area entirely.) As you can see, CSAVE uses
IBM standard SAVE & RETURN macros.
Your ideas are appreciated.
Colin Campbell