IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

help on 'HELLO, WROLD' program.


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jan 10, 2011 10:10 am
Reply with quote

Hello,

Quote:
Thanks for your suggestion, Bill.
You need to consider this as much stronger than a suggeston.

If you refuse to use standard linkage for every assembler module you will cause yourself (and probably others) a great amount of trouble. . .
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Jan 10, 2011 2:29 pm
Reply with quote

So, the final edition should be like below:
Code:
BEGIN    CSECT                                                       
         SAVE  (14,12)                                               
         BALR  R3,0                                                   
         USING *,R3   
         LA    R15,REGSAVE             POINT TO OUR SAVEAREA
         XC    0(REGSAVEL,R15),0(R15)  ENSURE X'00'S
         ST    R13,4(,R15)             BACKWARD-CHAIN
         ST    R15,8(,R13)             FORWARD-CHAIN
         LR    R13,R15                 POINT TO OUR SAVEAREA                                                 
         OPEN  (TEACHERS,(INPUT))      OPEN INPUT FILE               
         LTR   R15,R15                                               
         BNZ   RTN2CLLR                                                   
LOOP     GET   TEACHERS,IREC           READ A SINGLE TEACHER RECORD   
         B     LOOP                    REPEAT                         
ATEND    CLOSE TEACHERS                 
         L     R13,4(,R13)             RESTORE CALLERS R13                               
RTN2CLLR      RETURN (14,12),RC=(15)
         DS    0F                      ENSURE ALIGNMENT
REGSAVE  EQU   *                       REGISTER-SAVEAREA
         DS    18F                     18-WORDS
REGSAVEL EQU   *-REGSAVE               RSA OVERALL-LGTH
                                       
TEACHERS DCB   LRECL=L'IREC,DSORG=PS,RECFM=FB,MACRF=(GM),             
               DDNAME=TEACHER,                                       
               EODAD=ATEND                                           
         LTORG                                                       
         YREGS
IREC     DS    CL80   
BEGIN    AMODE 24     
BEGIN    RMODE 24     
         END 
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Jan 10, 2011 2:37 pm
Reply with quote

I wouldn't use R15 when setting up SAVEAREA and your RTN2CLLR label should be on the L R13,4(R13) statement.

Garry.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon Jan 10, 2011 6:26 pm
Reply with quote

Garry,

At this point in the program, R15 is considered a work-register (it's prior to the OPEN) and so, it can be used as such.

Bill
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon Jan 10, 2011 6:32 pm
Reply with quote

Bill,
Accepted, but I would still prefer to avoid using R15.
Garry.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Mon Jan 10, 2011 6:33 pm
Reply with quote

Garry Carroll wrote:
RTN2CLLR label should be on the L R13,4(R13) statement.

Garry.


Yes, correct...
I find myself so careless sometimes...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top