Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

use of EQU * in program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
er_neo

New User


Joined: 10 Jan 2006
Posts: 18
Location: Indore

PostPosted: Fri Apr 11, 2008 5:41 pm    Post subject: use of EQU * in program
Reply with quote

Can anyone help me out in finding out what EQU * does when we use it in program.

For example following line as the first line of any para/lable

MP1005 EQU *

and some times we also use

MP1010 CKEQU *


Thanks
Bharat
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Fri Apr 11, 2008 5:54 pm    Post subject:
Reply with quote

From distant memory (college course in 1967) - * refers to "here" - so this EQUates the name with this address.

Real assembler programmers - please aadvise.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Apr 11, 2008 6:14 pm    Post subject: Re: use of EQU * in program
Reply with quote

In your example, MP1005 EQU * translates to; equate the current location counter to this label MP1005.

I'm unsure about MP1005 CKEQU *, because CKEQU is not a valid Assembler directive. Perhaps it's an in-house Macro which expands into an EQU *?

Somtimes a DS 0H is used in place of the EQU *, to ensure alignment.

HTH....

Regards,

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

New User


Joined: 10 Jan 2006
Posts: 18
Location: Indore

PostPosted: Fri Apr 11, 2008 6:33 pm    Post subject:
Reply with quote

Bill,
by your explainaing am i correct to derive a conclusion that at the begining of every label i have to use this EQU * dircetive?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Apr 11, 2008 7:01 pm    Post subject:
Reply with quote

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

CICS Moderator


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

PostPosted: Fri Apr 11, 2008 7:10 pm    Post subject:
Reply with quote

er_neo wrote:
Bill,
by your explainaing am i correct to derive a conclusion that at the begining of every label i have to use this EQU * dircetive?

My answer to this is "It depends".

Most of the time, an EQU * will suffice to equate the current location counter to the given label.

However, if you find existing code that uses a DS 0H as opposed to an EQU * to the current location counter, then this indicates that the programmer wanted to ensure alignment of the next instruction on a halfword-boundary.

Some Assembler programmers specify a label and at that label, they're issuing an instruction, for example, an MVC.

This is also valid, but (IMHO), including the EQU * of the label then followed by the instruction is good documentation and will not cause the load-module to be any larger.

So, it's up to the programmer as to how the label is defined and used in the given program. Personally, a label with an EQU *, then the next line specifying an instruction is my preference.

An EQU * can be used in many other ways, such as dynamically calculating a length or the remaining storage (IE: FILLER) of an area, something I wish COBOL would add to their next version. icon_cool.gif

EG:

Code:

STGDSECT DSECT                     CALLER'S REENTRANT-STG           
STGAREA  DS    0XL256              BEGIN CALLER-STG                       
RETNCODE DS    H                   RETURN-CODE HWORD                     
OFFSET   DS    H                   ALIGNED HWORD-OFFSET WORKAREA         
WRKFWORD DS    F                   ALIGNED FWORD-WORKAREA                 
RTNREGSA DS    F                   ALIGNED FWORD-SAVEAREA                 
DBLWORD  DS    D                   ALIGNED DBLWORD-WORKAREA               
REGSAVE  DS    18F                 18-WORD REGISTER-SAVEAREA             
OPENSTAT DS    CL1                 STATUS OF CALLER'S FILE               
WTOMSGA  DS    CL71                WTO-MSGAREA                           
EMPTYFIL DS    CL1                 EMPTY-FILE ('Y')                       
STGCALCR EQU   STGAREA+L'STGAREA-* CALCULATED STG-REMAINDER               
STGRMNDR DS    XL(STGCALCR)        REMAINING-STG                         

Basically, this calculation is "Calculate STGCALCR = Address of STGAREA plus the length of STGAREA minus the Current Location Counter". In this example, the result is X'0057'.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Apr 11, 2008 9:18 pm    Post subject:
Reply with quote

Hello,

From long ago (when there were no online editors and assembler was "punched" on cards) the EQU * was often used so that a label could be put on a statement that was NOT an instruction. If it was necessary to add some instruction(s) after the label yet before the instruction extra "punch"ing was required. Also, using the EQU * often made the code more readable.
Back to top
View user's profile Send private message
er_neo

New User


Joined: 10 Jan 2006
Posts: 18
Location: Indore

PostPosted: Mon Apr 14, 2008 11:57 am    Post subject:
Reply with quote

Thanks a ton to all for such a nice explaination.
This helped my matter a lot.
Thanks again
Back to top
View user's profile Send private message
manikawnth

New User


Joined: 07 Feb 2007
Posts: 61
Location: Mumbai

PostPosted: Wed Apr 30, 2008 3:12 am    Post subject: @All
Reply with quote

It is better to use EQU * in a control section, only if we ensure that there are no data declarations in between.
All the instructions in assembler should be alligned to half-word boundary. and all the ad-cons adn v-cons should be aligned to fullword/double word boundaries.
It would result in a s0c6 abend, by improper use of EQU *
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us