I

 

 

31

6ð OBJ1L

I

 

 

61

7ð OBJ1T

C\

 

 

 

 

C\ Prepare for divide-by-zero situation

 

C\

 

 

 

 

C

 

Z-ADD1ð

FACT1

C

 

Z-ADDð

FACT2

C\

 

 

 

 

C\ and divide by ð

 

 

 

C\

 

 

 

 

C

FACT1

DIV FACT2

RESULT

C\

 

 

 

 

C\ should not get here due to divide-by-ð exception

C\

 

 

 

 

C

 

MOVE '1'

\INLR

 

C

 

RETRN

 

 

C\

 

 

 

 

C\ Program exception subroutine:

 

 

C\

 

 

 

 

C

\PSSR

BEGSR

 

 

C\

 

 

 

 

C\ Make sure we are not catching an exception due to the \PSS￿R

C\ subroutine itself

 

 

 

C\

 

 

 

 

C

SWITCH

IFEQ ' '

 

 

C

 

MOVE '1'

SWITCH

1

C\

 

 

 

 

C\ Set API error code to work in nonexception mode

C\

 

 

 

 

C

 

Z-ADD16

QUSBNB

 

C\

 

 

 

 

C\ Record the source listing line number that

caused the fa￿ilure

C\

 

 

C\

First, extract the numeric portion of

the PSDS line number￿

C\

 

 

C

 

Z-ADD8

X

C

 

Z-ADD8

Y

C

 

Z-ADDð

LIN#C

 

C

SRC,X

DOWEQ' '

 

 

C

 

SUB

1

X

 

C

 

END

 

 

 

C

X

DOWGTð

 

 

C

 

MOVE SRC,X

TGT,Y

 

C

 

SUB

1

X

 

C

 

SUB

1

Y

 

C

 

END

 

 

 

C\

 

 

 

 

 

C\

Then record it:

 

 

 

C\

 

 

 

 

 

C

 

Z-ADDLIN#C

FAILPT

 

C\

 

 

 

 

 

C\ Record the status code for the failure

 

C\

 

 

 

 

 

C

 

MOVELSTATUS

DATA

 

C\

C\ Record where to find the status data within DATA

C\

 

 

C

Z-ADDð

DTAOFF

B-118System API Programming

V4R1

 

Page 396
Image 396
IBM Version 4 FACT1 DIV FACT2 Result, INLR Retrn, PSSR Begsr, Switch, LIN#C SRC,X Doweq SUB END, ADDLIN#C Failpt