How to receive parameters in an asynchronous Timer exit rout



High Level Assembler(HLASM) for MVS & VM & VSE

How to receive parameters in an asynchronous Timer exit rout

Postby anilkumar141986 » Fri Jul 30, 2010 1:47 pm

Hi ,

How can i receive parameters in an asynchronous timer exit routine set using STIMERM macro?

I tried searching IBM manuals but could not find one. In which register will i receive the parameters or in what memory area should i search for to obtain parameters sent by a program which set the timer.

regards,
Anil
anilkumar141986
 
Posts: 7
Joined: Tue Aug 05, 2008 1:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to receive parameters in an asynchronous Timer exit rout

Postby steve-myers » Fri Jul 30, 2010 5:32 pm

What do you mean by "parameters?" Basically, the program that establishes the STIMERM exit routine must store anything the exit routine requires in storage that is convenient to the exit routine.

The STIMERM macro can specify the address of a 4 byte area that contains some sort of data that may be useful to the exit routine. MVS Assembler Service Reference shows a character string, but it can be an address of something the exit routine can find useful, like an ECB for it to POST to indicate the timer interval has expired. This is much better than the minimal interface provided by the old OS/360 STIMER macro. This is a complete program to wait for 1 second.
WAIT1SEC TITLE '                                       WAIT FOR ONE SEC>
               OND'
         SPACE 5
WAIT1SEC CSECT                     ESTABLISH CSECT
WAIT1SEC AMODE ANY                 DEFINE THE AMODE
WAIT1SEC RMODE ANY                 DEFINE THE RMODE
W        DSECT                     DEFINE THE WORK AREA
TPARMS   STIMERM SET,MF=L          STIMERM PARM LIST
TPARM    EQU   TPARMS,*-TPARMS     DEFINE THE FULL STORAGE AREA FOR   ->
                                    STIMERM PARM LIST
PARMWORD DS    A                   PARAMETER PASSED TO THE EXIT ROUTINE
ECB      DS    F                   EVENT CONTROL BLOCK POSTED BY THE  ->
                                    EXIT ROUTINE
S        DS    9D                  OS/360 SAVE AREA
WL       EQU   *-W                 LENGTH OF THE WORK AREA
WAIT1SEC CSECT                     RETURN TO THE CSECT
         USING *,12                ESTABLISH WAIT1SEC ADDRESSABILITY
         USING W,11                ESTABLISH WORK AREA ADDRESSABILITY
         SAVE  (14,12),,WAIT1SEC-&SYSDATE-SYSTIME  SAVE REGISTERS
         LR    12,15               COPY THE ENTRY POINT ADDRESS TO    ->
                                    REG 12
         LHI   0,WL                LOAD THE LENGTH OF THE WORK AREA
         GETMAIN RU,LV=(0),LOC=(ANY,ANY)  ALLOCATE THE WORK AREA
         LR    11,1                COPY THE WORK AREA ADDRESS TO REG 11
         LA    15,S                LOAD THE ADDR OF THE NEW SAVE AREA
         ST    13,4(,15)           ADD THE NEW SAVE AREA
         ST    15,8(,13)            TO THE SAVE AREA CHAIN
         LR    13,15               ESTABLISH THE NEW SAVE AREA POINTER
         MVI   ECB,0               SET THE ECB AS NOT WAITING,        ->
                                    NOT POSTED
         ST    11,PARMWORD         STORE THE WORK AREA ADDRESS IN     ->
                                    PARMWORD
         MVC   TPARM,TPARMM        COPY THE MASTER STIMERM PARM LIST  ->
                                    TO THE WORK AREA
         STIMERM SET,BINTVL==F'100',WAIT=NO,EXIT=ITIMEUP,  ESTABLISH  ->
               ID=TIMEID,PARM=PARMWORD,MF=(E,TPARM)    A TIMER INTERVAL
WAITMAC  WAIT  1,ECB=ECB           WAIT FOR THE TIMER INTERVAL TO     ->
                                    COMPLETE
         L     13,4(,13)           LOAD THE ADDRESS OF THE PREVIOUS   ->
                                    SAVE AREA
         LHI   0,WL                LOAD THE LENGTH OF THE WORK AREA
         FREEMAIN RU,A=(11),LV=(0) FREE THE WORK AREA
         RETURN (14,12),T,RC=0     RESTORE REGS & RETURN
         DC    0D'0'               FORCE DOUBLE WORD ALIGNMENT
         USING *,12                ESTABLISH STIMERM EXIT ROUTINE     ->
                                    ADDRESSABILITY (WORK AREA         ->
                                     ADDRESSABILITY IS INHERITED      ->
                                      BECAUSE IT WAS NEVER DROPPED)
ITIMEUP  SAVE  (14,12),,ITIMEUP    SAVE REGISTERS IN THE SAVE AREA    ->
                                    AREA PROVIDED BY THE TIMER        ->
                                     INTERRUPT ROUTINE
         LR    12,15               COPY THE ADDRESS OF ITIMEUP TO     ->
                                    REG 12
         L     11,4(,1)            LOAD THE ADDRES OF THE WAIT1SEC    ->
                                    WORK AREA
         POST  ECB,0               POST THE COMPLETTION ECB
         RETURN (14,12)            RESTORE REGISTERS & RETURN TO THE  ->
                                    MVS TIMER INTERRUPT FUNCTION
TPARMM   STIMERM SET,MF=L          MASTER STIMERM PARM LIST
TIMEID   DC    CL4'TIME'           TIMER ID
         DC    0D'0'               FORCE DOUBLE WORD ALIGNMENT
         LTORG ,                   DEFINE THE WAIT1SEC LITERAL POOL
         END   WAIT1SEC
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to Assembler

 


  • Related topics
    Replies
    Views
    Last post