Your partway was the wrongway anyway
as already somebody told You ...
the register save should precede the setting up of the base register
and as usual You did not care to read the z390 documentation,
You just copied thing without trying to understand
the subentry and the subexit macros ...
.* MACRO-ID. 'SUBENTRY'
.* AUTHOR. DON HIGGINS.
.* DATE WRITTEN. 07/28/70.
.* REMARKS. THIS MACRO GENERATES THE CODE TO ESTABLISH A
.* CSECT WITH SAVE AREA AND BASE REGISTER USING
.* STANDARD OS LINKAGE CONVENTIONS.
so no reason at all to redo what has already been done ( saving the registers and <loading> the base register )
and ... did You notice that the SUMRTN was entered once, but
as usual if You had read the documentation and followed the run time instructions
You would have noticed that both in the console log and in lab6a.log the register 15 contains a nice 0, hence the 0c1
repeat novemtrigillion times
any subroutine using zOS macros must abide the CALL conventions and save/restore properly the registerswhen You will have gained more experience You might be stingy to save and restore only the register being used
like I did in the quick and dirty mod I made
but to start with, just follow the normal/best practice of saving and restoring everythingafter fixing the obvious I got the correct results
18:41:14 lab6a EZ390 START USING z390 V1.5.05 ON J2SE 1.6.0_29 11/23/11
NONSENSE FROM SUMRTN
NONSENSE FROM SUMRTN
NONSENSE FROM SUMRTN
THE SUM OF THE NUMBERS FROM 1 TO 100 IS 5,050
18:41:14 lab6a EZ390 ENDED RC= 0 SEC= 0 MEM(MB)= 14 IO=24 INS=340
I just made the simple hack of defining a save area for R15
here is the <fixed> thing
LAB6A SUBENTRY
LA 1,DATA
BAL 15,SUMRTN
BAL 15,SUMRTN
BAL 15,SUMRTN
LA 3,X'00000000'
LA 4,X'00000001'
LA 5,X'00000063'
ZAP B,=P'0'
ZAP SUM,=P'0'
ZAP A,=P'1'
LOOP DS 0H
AP B,A
AP SUM,B
BXLE 3,4,LOOP
MVC FIELD,MASK
ED FIELD,SUM
WTO MF=(E,WTOMSG)
SUBEXIT
WTOMSG DC AL2(WTOMEND-*,0)
HELLO DC C'THE SUM OF THE NUMBERS FROM 1 TO 100 IS '
FIELD DS CL10
WTOMEND EQU *
*
MASK DC X'40206B2020206B202020'
PRNTLINE DS CL133
SUM DS PL4
B DS PL4
A DS PL4
C DS PL4
CB DS PL4
DB DS PL4
SAVEAREA DS 18F
SAV15 DS F
DATA DC CL5'00800'
SUMRTN DS 0H
ST 15,sav15
WTO 'NONSENSE FROM SUMRTN'
L 15,sav15
BR 15
ENDPGM DS D
END LAB6A
now it it the time to stop wasting time creating what You properly define stupid gibberish
and start rereading all the post You have made, trying to understand the answers You were given !