Joined: 26 Apr 2022 Posts: 9 Location: United States
Hi,
After 30+ years as a MF Storage Admin, working for clients and vendors, I am trying to learn z/OS Assembler. I am in a program thru Marist College with IBM and I'm struggling with some basic stuff.
I have an assignment in which the instructor provided an example of a floating point overflow and we were to comment out a load for Register 5 and SPM statement, create the overflow, and branch on overflow. Then uncomment those two lines and run it again to see the abend.
The assignment was to then do the same to cause a decimal overflow using packed data. I've done that.
L R5,=X'0A000000' ENABLE ABEND...
SPM R5 ...ON DECIMAL OVERFLOW
However, it doesn't abend even when the overflow happens. In John Ehrman's book it says to test for an 'A' for decimal overflow. The fixed point overflow test used an '08'
Can anyone explain why this isn't resulting in an abend?
I did some searches and found an old APAR that was for COBOL calling an Assembler macro in which, in an LE environment, the abend wasn't taking place but I don't think that's related.
I have attached the program source and the output of a run.
1. It is strongly recommended not to use attached files in your messages. Use the CODE fragments instead:
Code:
. . . . . .
IEF236I ALLOC. FOR KC03I712 G STEP1
IGD103I SMS ALLOCATED TO DDNAME PGM=*.DD
IEF237I JES2 ALLOCATED TO FILEOUT1
IEF237I JES2 ALLOCATED TO SYSUDUMP
PROGRAMMER NOTE: ADDING TO PKFAIL
PROGRAMMER NOTE: PACKED OVERFLOW DETECTED
IEF142I KC03I712 G STEP1 - STEP WAS EXECUTED - COND CODE 0000
. . . . . . .
2. You have two typos in your code:
Code:
000014 5850 C1C2 001C8 17 L R5,=X'000A0000' ENABLE ABEND...
here your mask is placed into the wrong bits of register 5, which is different from your separate source code
and
Code:
0000CC 5C 63 PKADDR DC PL1'15'
here you get the constant +5 instead of +15
Anyway, the Decimal Overflow mask bit should be 0, and 999+5 must result in ABEND S0CA. So far it is not clear why this did not happen? Aren't there other mistyped errors in your code?
The reason is: misunderstanding of the program mask bits value.
Quote:
When the mask bit is one, the exception results in an interruption (and highly likely, further ABEND).
When the mask bit is zero, no interruption occurs (and no ABEND can be expected).
So, in order to allow only Decimal Overflow ABEND, you need to set one single bit of the Program Mask; it is desirable not to touch any other bit, unless you need to modify them, too.
(The Decimal Overflow control bit is actually B'00000100', or X'04' of the hi-order byte of the register.)
Code:
IPM R5 get current settings for all Program Mask bits
O R5,=X'04000000' set 1 to the Decimal Overflow control bit
SPM R5 replace the Program Mask with one changed bit
In this case all decimal overflows shall cause the ABEND S0CA, while other ABENDs will depend on other Program Mask bit settings.
Joined: 26 Apr 2022 Posts: 9 Location: United States
The first error, checking the wrong bit, I appreciate. I'd been trying all kinds of stuff including different bytes. Yes, it needed to be moved to the first bit.
The second, I did misunderstand. In Chapter V, Assembler Language Programming for IBM System z(TM) Servers, at the top of page 235 it has checking bit 36 for'08' (fixed-point overflow), bit 37 for '0A' (decimal overflow), bit 38 for '0D' for Hexadecimal floating-point underflow, and bit 39 for '0E' for Hex floating-point lost significance. Since the instructor's sample worked when checking for a '08' I assumed using '0A' would be correct.
Obviously I assumed poorly; however, changing to '0D' did result in the S0CA abend. Following your response, I tested with '04' and it did result in the SOCA abend.
Thank you.
I've got a bunch more to work through over the next couple of weeks I hope not to abuse your generosity.
The first error, checking the wrong bit, I appreciate. I'd been trying all kinds of stuff including different bytes. Yes, it needed to be moved to the first bit.
The second, I did misunderstand. In Chapter V, Assembler Language Programming for IBM System z(TM) Servers, at the top of page 235 it has checking bit 36 for'08' (fixed-point overflow), bit 37 for '0A' (decimal overflow), bit 38 for '0D' for Hexadecimal floating-point underflow, and bit 39 for '0E' for Hex floating-point lost significance. Since the instructor's sample worked when checking for a '08' I assumed using '0A' would be correct.
Obviously I assumed poorly; however, changing to '0D' did result in the S0CA abend. Following your response, I tested with '04' and it did result in the SOCA abend.
Thank you.
I've got a bunch more to work through over the next couple of weeks I hope not to abuse your generosity.
You have mixed two different entities: the bits of the Program Mask, and the Exception Codes after a program interruption occurs.
The Program Mask bits (in PSW, or in the hi-order byte of the register used in IPM/SPM) are as follows:
Code:
B'00110000' - two bits of the last Condition Code
B'00001000' - Fixed Point Overflow mask bit
B'00000100' - Decimal Overflow mask bit
B'00000010' - HFP Exponent Underflow mask bit
B'00000001' - HFP Significance mask bit
other bits are ignored by IPM/SPM instructions.
After the program exception occurs (when allowed by the corresponding Program Mask bit), then the Interruption (or Exception) Code is set as follows (for the Exception Handling Routine to be able to recognize the reason of the exception):
Please note, that only 4 of 15 possible exceptions may be either masked or allowed by setting the Program Mask bits.
When any Program Exception occurs, the control is passed either to the user-defined SPIE routine, or to the System Exception Handle routine; any of them can check the Interruption Code to find out what has caused this exception.
The System Exception Handler initiates the system ABEND with the ABEND code equal to 'S0Cx', where 'x' is the number of the Program Exception.
In case of Decimal Overflow the expected ABEND is S0CA