Hi Steve,
Not sure how I managed to use DS 0C there.
The thought to my indexing was to have code that would essentially say:
- Point argument 1 to MODNAME
- Point argument 2 to MODSIZE
- Point R5 to argument 3
So in "pseudo-assembler", where [n] represents a subscript I might have
something like this:
L R10,ARG[1]
USING MODNAME,R10
L R10,ARG[2]
USING MODSIZE,R10
LA R4,PDS2NAME
L R5,ARG[3]
LOAD DE=(R4),LOADPT=(R5)
No need to name the argument addresses themselves.
I don't know if something like the above is available.
All that being said, I assume you are suggesting something like this:
ARGS DSECT , ARG LIST
NAME@ DS A
SIZE@ DS A
ENTRY@ DS A
L R10,NAME@
USING MODNAME,R10
L R10,SIZE@
USING MODSIZE,R10
LA R4,PDS2NAME BLDL ENTRY FOR DE PARM
L R5,ENTRY@ LOADPT WILL BE STORED IN ARG 3
LOAD DE=(R4),LOADPT=(R5) NOW LOAD THE MODULE
That seems quite worthy. Thanks for the input!
Frank
From: Steve Smith <[email protected]>
To: [email protected]
Sent: Tuesday, December 8, 2015 8:15 PM
Subject: Re: review my program?
The one main thing I see is that you should never have a code label on a
DS 0C (or EQU*). DS 0H (or DC 0H) is the usual thing. Sooner or later,
such a label will assemble to an odd address, and you'll have to fix it.
Indexing through the ARG list doesn't make much sense here. Elaborate
the ARG Dsect to have labels for each argument and refer to them. That
eliminates the need for your AFIs, but that's the least of the benefit.
Also, fix your email so I can reply to the list, not your personal email.
sas
On 12/8/2015 19:43, Frank Swarbrick wrote:
I am not a sysprog, and I don't often write assembler (and when I do I've often
forgotten many things I once knew). I'm wondering if someone might take a look
at a little assembler routine I wrote to load a 'data only assembler table' and
retrieve its length as well. It will be called with something like this:
identification division.
program-id. sizetst.
data division.
working-storage section.
01 modsize pic s9(8) comp-5.
01 modname pic x(8).
01 rowcnt pic s9(9) comp-5.
linkage section.
01 mytab.
05 myrow pic x(80) occurs unbounded
depending on rowcnt
indexed by rownbr.
procedure division.
move 'XML1V2K' to modname
call 'MODLOAD' using modname modsize
address of mytab
compute rowcnt = modsize / 80
perform varying rownbr from 1 by 1 until rownbr > rowcnt
display myrow(rownbr)
end-perform
goback.
end program sizetst.
And here is the program:
*PROCESS RENT
SYSSTATE ARCHLVL=2
MODLOAD CEEENTRY MAIN=NO,AUTO=L'LOCALSTG
DROP R11 WE DON'T NEED NO STINKIN' BASE REG!
USING LOCALSTG,CEEDSA Auto stg and DSA use the same base LR
R11,R1 SAVE ARG LIST ADDR IN R11
USING ARGS,R11
BLDLSIZE DS 0C CALL BLDL TO GET MODULE SIZE
LHI IDX,0 R2 = INDEX TO ARG 1
L R10,ARG(IDX)
USING MODNAME,R10
MVHHI BLDL_FF,1 NBR OF RESULT ENTRIES FOR BLDL
MVHHI BLDL_LL,BLDLDELN LEN OF EACH BLDL ENTRY
MVC PDS2NAME,MODNAME
BLDL 0,BLDLAREA
LTR R15,R15 CHECK RETURN CODE
JNZ RETURN RETURN IF NOT ZERO
AFI IDX,L'ARG INDEX NEXT ARG (ARG 2)
L R10,ARG(IDX)
USING MODSIZE,R10
MVI MODSIZE,0 INITIALIZE BYTE 1
MVC MODSIZE+1(3),PDS2STOR COPY 2-4 FROM PDS2STOR
LOAD DS 0C CALL LOAD TO LOAD THE MODULE
LA R4,PDS2NAME BLDL ENTRY FOR DE PARM
AFI IDX,L'ARG INDEX NEXT ARG (ARG 3)
L R5,ARG(IDX) LOADPT WILL BE STORED IN ARG 3
LOAD DE=(R4),LOADPT=(R5) NOW LOAD THE MODULE
RETURN CEETERM RC=(R15),MODIFIER=(R0)
DROP R11,R10
DROP R13
*
PPA CEEPPA VER=1,REL=1,MOD=0 SERVICE=?
CEEDSA ,
CEECAA ,
*
ARGS DSECT , ARG LIST
ARG DS 3A 3 ARGS
*
MOD_NAME DSECT , ARG #1
MODNAME DS CL8
*
MOD_SIZE DSECT , ARG #2
MODSIZE DS F
*
@LOCALSTG DSECT , AUTOMATIC STORAGE WORK AREA
ORG *+CEEDSASZ Leave space for the DSA fixed partBLDLAREA
DS 0CL77
BLDL_FF DS H NUMBER OF ENTRIES
BLDL_LL DS H NUMBER OF BYTES PER ENTRY
IHAPDS DSECT=NO
LOCALSTG EQU @LOCALSTG,*-@LOCALSTG,C'C'*
BLDLDELN EQU L'BLDLAREA-L'BLDL_FF-L'BLDL_LL
YREGS ,
IDX EQU R2
It works as designed. Any and all constructive comments are
welcome!Thanks,Frank
The information contained in this electronic communication and any document
attached hereto or transmitted herewith is confidential and intended for the
exclusive use of the individual or entity named above. If the reader of this
message is not the intended recipient or the employee or agent responsible for
delivering it to the intended recipient, you are hereby notified that any
examination, use, dissemination, distribution or copying of this communication
or any part thereof is strictly prohibited. If you have received this
communication in error, please immediately notify the sender by reply e-mail
and destroy this communication. Thank you.