Important: The TIMEUSED macro is NOT throwing an error. In the assembler
routine, I changed the BNZ AGAIN to branch to an Abend: BNZ ABEND_0001....
It never branched to the abend label.
This routine returns different results when invoked Static versus Dynamic from
IBM COBOL 6.
The values from the Dynamic call appear to be correct.
05 WS-VALUE PIC 9(12)V9(6) COMP-5.
Dynamic: CALL WS-CPUTIME USING WS-VALUE returns:
00000000000000 V 002176 Run 1
00000000000000 V 204318 Run 1
00000000000000 V 205151 Run 2
00000000000000 V 406169 Run 2
00000000000000 V 406418 Run 3
00000000000000 V 596453 Run 3
00000000000000 V 596666 Run 4
00000000000000 V 787845 Run 4
Static: CALL 'CPUTIME' USING WS-VALUE returns: (Compiler option is
NODYNAM. Invoking in Batch)
00000000000000 V 000000 Run 1
04984731896912 V 019456
04984772785000 V 677376 Run 2
04997547254689 V 562624
04997556669257 V 875456 Run 3
05009620716996 V 263936
05009629513089 V 286144 Run 4
05021729707272 V 437760
I have run out of ideas on what could cause the results to be different when
the routine is invoked via a Static call.
This is the assembler routine.
TITLE 'Get CPU TIME in Microseconds'
CPUTIME CSECT
CPUTIME AMODE 31
CPUTIME RMODE ANY
* Start: Program Entry
STM R14,R12,12(R13) Save registers in callers's SaveArea
LR R12,R15 BASE REGISTER FOR THIS PGM = R12
@PSTART EQU CPUTIME
USING @PSTART,R12
ST R13,SaveArea+4 BACK CHAIN : CALLER'S IN OUR'S
LA R14,SaveArea
ST R14,8(,R13) FORWARD CHAIN: OUR'S INTO CALLER'S
LR R13,R14 PUT ADDRESS OF OUR SAVEAREA IN R13
*
*---------------------------------------------------------------------
* PROGRAM LOGIC
THISPGM EQU *
L R2,0(R1) Parm 1: PIC 9(12)V9(6) or 9(18) COMP-5.
AGAIN TIMEUSED STORADR=(R2),LINKAGE=SYSTEM,CPU=MIC
BNZ AGAIN
*
*---------------------------------------------------------------------
* Program Exit Successful CC = 00
DONE EQU *
XR R15,R15 RC=00
L R13,4(,R13) Restore Caller's savearea Address
L R14,12(,R13) Caller's Return Address
LM R0,R12,20(R13) Restore caller's R0 thru R12
BR R14
*-------------------------------------------------------------------
SAVEAREA DS 18F
DATA LTORG
COPY REGISTER
END
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN