Article View: comp.lang.asm370
Article #662Re: execute / list forms of MVS system macros
From: "Stephen E. Bacher"
Date: Thu, 11 Apr 1991 11:48
Date: Thu, 11 Apr 1991 11:48
55 lines
2865 bytes
2865 bytes
In message <40391.2803bc39@ccfvx3.draper.com>, "John M. Kelsey"
<C445585%UMCVMB.BITNET@ohstvma.acs.ohio-state.edu> asks:
> Can anyone explain what list and execute forms of systme macros is
> used for, and how it works? I've been looking through a manual that
> continually refers to list and execute forms of macros, but doesn't
> explain what the @#$% they are....
Briefly (since you'll probably get many responses)...
List and execute forms of macros are needed for reentrant programs.
Since system macros usually expand into SVC's or calls to system
routines that require parameter lists, those parameter lists have
to be built somewhere. Typically a macro will build the list inline
and have the code jump over it, but since the parameter list has to be
built by macro-generated code at run time (and sometimes gets updated
by the system service itself), this technique is not valid for a
reentrant program.
Hence, the list and execute forms. The list form is used to construct
just the parameter list, and the execute form actually calls the
system service given a pointer to the parameter list you've built
via the LIST form.
The catch is that for truly reentrant code, you've often got to code
the LIST form twice: once in your code, to establish the parameter
settings in the list, and once in your GETMAINed area, so that the
copy the system service uses is mutable. You would then have to copy
the static one to the dynamic one before using, which means that you
may have to set up a length equate to do it. Example:
In your static data section:
STATIC_FOO FOOMAC FOO=1,BAR=2,MF=L
FOO_LENGTH EQU *-STATIC_FOO
In your dynamic (DSECT) data section:
DYNAMIC_FOO FOOMAC FOO=1,BAR=2,MF=L
Note that even though this will be in a DSECT where values are
irrelevant because it's all gotten at run time, it's usually a
good idea to include all the parameters, mainly because which
parameters you specify often determines the size of the parameter
list at assembly time.
In your executable code...
MVC DYNAMIC_FOO(FOO_LENGTH),STATIC_FOO
FOOMAC MF=(E,STATIC_FOO)
Hope this helps. (Maybe it wasn't so brief after all...:-)
- Steve Bacher <seb1525@mvs.draper.com>
- Draper Laboratory
Technical Details
Message-ID:
<9104111325.AA07154@ucbvax.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uwm.edu!bionet!agate!ucbvax!mvs.draper.COM!seb1525Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!uwm.edu!bionet!agate!ucbvax!mvs.draper.COM!seb1525
From: seb1525@mvs.draper.COM ("Stephen E. Bacher")
Newsgroups: comp.lang.asm370
Subject: Re: execute / list forms of MVS system macros
Message-ID: <9104111325.AA07154@ucbvax.Berkeley.EDU>
Date: 11 Apr 91 11:48:00 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: IBM 370 Assembly Programming Discussion List
<ASM370@OHSTVMA.BITNET>
Distribution: inet
Organization: The Internet
Lines: 55