MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Assembler: Different alignments

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rnanavaty
Beginner


Joined: 12 Apr 2006
Posts: 29
Topics: 20

PostPosted: Mon Nov 02, 2009 4:19 am    Post subject: Assembler: Different alignments Reply with quote

Hi,

What is the difference between different type of alignments like:


MYEPPR CNOP 0,2 Halfword alignment.
NEWPARA CNOP 0,4 Fullword alignment.
MN01EP CNOP 0,8 EP on doubleword boundary.

2) What is the use of those alignments and when to usewhich one?
Back to top
View user's profile Send private message
RonB
Beginner


Joined: 02 Dec 2002
Posts: 93
Topics: 0
Location: Orlando, FL

PostPosted: Mon Nov 02, 2009 7:52 am    Post subject: Reply with quote

1) The answer to your first question is obvious from the comments following each instruction.
2) Each is used to force "slack" bytes, as needed, and if required, in order to set the current address pointer to the requested boundary alignment. This is useful, for example, when you wish to "simulate" an exec parm when passing parameters to another program ( where the requirement is that the LENGTH of the parm is contained in a halfword aligned on a halfword boundary )
_________________
A computer once beat me at chess, but it was no match for me at kick boxing.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Nov 02, 2009 8:50 am    Post subject: Reply with quote

2) many assembler instructions require that one or all operands be on a boundary.

the assembler manual will indicate for each instruction the constraints.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Nov 02, 2009 3:36 pm    Post subject: Reply with quote

also, the executable assembler instructions themselves must be on a half word boundary, so a CNOP (which is a 0700 or branch register 0, or do nothing) can be used in cases where inline data is being branched around. as Ron said. The effect outside of executable code is basically the same as a DS 0H, DS 0F, or DS 0D if I remember right (there may be different idiosyncrasies with each idiom, like where labels point and what gets placed in the generated object code).
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Tue Dec 22, 2009 8:20 am    Post subject: Reply with quote

Not to mention consistency. If you write mutli-tasking programs aligning data on integral boundaries ensures consistency across multiple CPUs. This is called a sequential memory model. Other hardware, such as AIX Power6 has a weakly defined architecture which requires memory barriers to ensure correct consistency or even stronger barriers such as mutexes. It's also a good idea to align data to make it easier to read in a dump.
_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group