Assembler Compiler JCL - asm with v-type constants



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

Assembler Compiler JCL - asm with v-type constants

Postby vlxdxmxr » Tue Oct 01, 2013 11:03 am

Hi everyone,

I am looking for a sample JCL that compiles and link two assembler programs.

The first assembler defines a V-type constant as shown below:

ENTRY MSG1,MSG2
.
.
.

MSG1 DC CL15'*HELLO WORLD1 *'
MSG2 DC CL15'*HELLO WORLD2 *'

The second program accesses the vcons variables in the manner shown below:

L R2,=V(MSG1)
ST R2,MSGADDR
WTO MF=(E,WTOBLOCK)
LTR R15,R15
BNZ ABENDX
*
***DISPLAY ADDRESS OF MSG2***
*
L R2,=V(MSG2)
ST R2,MSGADDR
MVI WTOMSG+14,C'2'
WTO MF=(E,WTOBLOCK)
LTR R15,R15
BNZ ABENDX


Thanks in advance!!!
vlxdxmxr
 
Posts: 1
Joined: Tue Oct 01, 2013 10:53 am
Has thanked: 0 time
Been thanked: 0 time

Re: Assembler Compiler JCL - asm with v-type constants

Postby steve-myers » Tue Oct 01, 2013 4:00 pm

By itself, the topic title mentions 2 issues.
  1. What is the JCL used to assemble and link two Assembler programs?
    This forum cannot provide a proper answer to this question. Every installation has its own standards, and you should follow that installations standards. In the 40+ years I've been writing Assembler programs I have used at least 6 different programs to assemble programs. Each program has its own requirements, and every installation may impose additional standards.
  2. What is the proper way to define external symbols in one module and access the data in a second statically linked module?
    There are many issues here; I have reduced the issues somewhat by the way I have worded the bullet topic. You should carefully study the ENTRY and EXTRN Assembler instructions in HLASM V1R6 Language Ref. These instructions have been essentially the same for every Assembler program I have used for OS/360 and its derivative operating systems.
    The V-type address constant sort of combines the EXTRN Assembler instruction and an A-type address constant, but it should only be used to provide the address of an external symbol that defines an executable program. In some infrequently encountered situations a V-type address constant used to access data will point to junk.
For what it's worth, the model you are using will not work, though it has nothing to do with using a V-type address constant.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Assembler Compiler JCL - asm with v-type constants

Postby steve-myers » Mon Oct 21, 2013 7:00 pm

This is correct.

The "main" program
EXWTO    CSECT
         USING *,12
         SAVE  (14,12),,*
         LR    12,15
         L     1,=V(WTO1)
         WTO   MF=(E,(1))
         L     1,=V(WTO2)
         WTO   MF=(E,(1))
         RETURN (14,12),T,RC=0
         LTORG ,
         END   EXWTO
The data module
WTODATA CSECT
        ENTRY WTO1,WTO2
WTO1    WTO   'FIRST WTO MACRO',MF=L,ROUTCDE=11,DESC=7
WTO2    WTO   'SECOND WTO MACRO',MF=L,ROUTCDE=11,DESC=7
        END   ,

Sample JCL to assemble, link, and run the modules. The modules are in a PDS in my userid.
//EXWTO   EXEC HLASMC
//SYSLIN   DD  DSN=&&EXWTO
//SYSIN    DD  DISP=SHR,
//             DSN=&SYSUID..LINKMOD.ASM(EXWTO)
//WTODATA EXEC HLASMC
//SYSLIN   DD  DSN=&&WTODATA
//SYSIN    DD  DISP=SHR,
//             DSN=&SYSUID..LINKMOD.ASM(WTODATA)
//LINK    EXEC PGM=IEWL,PARM='MAP,LIST'
//SYSPRINT DD  SYSOUT=*
//SYSLMOD  DD  DISP=(,PASS),UNIT=SYSDA,
//             SPACE=(CYL,(1,1,1)),DSN=&&G(G)
//EXWTO    DD  DISP=(OLD,DELETE),
//             DSN=&&EXWTO
//WTODATA  DD  DISP=(OLD,DELETE),
//             DSN=&&WTODATA
//SYSLIN   DD  *
 INCLUDE EXWTO,WTODATA
//RUN     EXEC PGM=*.LINK.SYSLMOD
//SYSUDUMP DD  SYSOUT=*
JCL like this will work in many installations, but it will almost certainly violate coding standards in most installations.

Notes.
  • The "main" program does not prepare a new save area because it does not call any subroutines. WTO is a system service invoked by an SVC instruction. The system code invoked by the SVC instruction preserves your registers in the system; it does not use or require the register save area whose address is in register 13.
  • A plain WTO macro (e.g. WTO 'THIS IS A WTO MACRO') prepares a parameter list that includes the message and invokes the system WTO service. The "execute" form of a WTO macro (e.g. WTO MF=(E,PARMLIST) ) load the address of a WTO parameter list and invokes the system WTO service. The "list" form of a WTO macro (e.g., PARMLIST WTO 'THIS IS A WTO MACRO',MF=L prepares the parameter list with a fixed message. A programmer that knows the parameter list can prepare a parameter list with a message containing variable data and use the "execute" form of the WTO macro to write the message.
  • The first and second steps overrides the data set name specified in the SYSLIN DD statement in the HLASMC cataloged procedure. The LINK step, which uses the Binder, which does not normally require a SYSUT1 DD statement, and creates load module G in temporary data set &&G. The RUN step executes the load module created by the LINK step. The LINK and RUN steps are typical of RYO (Roll Your Own) JCL.
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