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

Fullword Boundary


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

New User


Joined: 19 Feb 2010
Posts: 27
Location: India

PostPosted: Thu Dec 09, 2010 7:21 pm
Reply with quote

Hello,

What will happen, if the operand given in the load fullword instruction is not on the fullword boundary?

E.g L R2,Mem and if Mem is not alligned on the fullword boundary.

I tried it and its working fine for me. Then what is the use of fullword here?

Can anybody help me?

Thank you,
Vijay
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Thu Dec 09, 2010 7:26 pm
Reply with quote

The instruction is LOAD - not LOAD FULLWORD.

Of course it works fine, the POP states
Quote:
The second operand is placed unchanged at the
first-operand location, except that, for LOAD
(LGFR, LGF), it is sign extended.


Garry.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Dec 09, 2010 7:32 pm
Reply with quote

IIRC, the requirement for loading from a fullword boundary was dropped when the 370 replaced the 360, around 40 years ago.
Back to top
View user's profile Send private message
vijay korde

New User


Joined: 19 Feb 2010
Posts: 27
Location: India

PostPosted: Thu Dec 09, 2010 7:34 pm
Reply with quote

Thank you Garry.

But in many assembler documents, "L' is considered as LOAD FULLWORD and the second operand should be alligned on fullword boundary.

Could you please clarify the concept?

Thank you,
Vijay
Back to top
View user's profile Send private message
vijay korde

New User


Joined: 19 Feb 2010
Posts: 27
Location: India

PostPosted: Thu Dec 09, 2010 7:42 pm
Reply with quote

Thank you Robert for the clarification.
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: Thu Dec 09, 2010 7:43 pm
Reply with quote

Yes, it does load a FULLWORD from storage or as a literal, but it's normally referred to as a LOAD because what it's loading is implicit.

You should also review LOAD HALFWORD and LOAD HALFWORD IMMEDIATE in the POPS manual and add the following link to your favorites -

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DZ9ZR003/CCONTENTS?SHELF=DZ9ZBK03&DN=SA22-7832-03&DT=20040504121320

You may get an alignment error (actually a warning) if the memory location is on an odd boundary, in which case, you can substitute the LOAD with an ICM with a mask of B'1111' (all bytes).

With that, an ICM sets the condition-code, so you can branch somewhere when the CC is a BZ or BNZ.

Bill
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Dec 09, 2010 7:46 pm
Reply with quote

depends on the IRON being used
once upon a time You would get a S0C6 (SPECIFICATION EXCEPTION)
on newer platforms You will only suffer a performance penalty

for example the ESA principles of operation states
Quote:
Programming Note: For fixed-field-length oper- ations with field lengths that are a power of 2, sig- nificant performance degradation is possible when storage operands are not positioned at addresses that are integral multiples of the operand length. To improve performance, frequently used storage operands should be aligned on integral bounda- ries.


the latest z/Architecture Principles of Operation (SA22-7832-08) confirms it
Quote:
Certain units of information must be on an integral boundary in storage. A boundary is called integral for a unit of information when its storage address is a multiple of the length of the unit in bytes. Special names are given to fields of 2, 4, 8, and 16 bytes on an integral boundary. A halfword is a group of two consecutive bytes on a two-byte boundary and is the basic building block of instructions. A word is a group of four consecutive bytes on a four-byte boundary. A doubleword is a group of eight consecutive bytes on an eight-byte boundary. A quadword is a group of 16 consecutive bytes on a 16-byte boundary. (See Figure 3-1 on page 3-4.)
When storage addresses designate halfwords, words, doublewords, and quadwords, the binary rep- resentation of the address contains one, two, three, or four rightmost zero bits, respectively.
Instructions must be on two-byte integral boundaries, and CCWs, IDAWs, MIDAWs, and the storage oper- ands of certain instructions must be on other integral boundaries. The storage operands of most instruc- tions do not have boundary-alignment requirements.
Programming Note: For fixed-field-length opera- tions with field lengths that are a power of 2, signifi- cant performance degradation is possible when storage operands are not positioned at addresses that are integral multiples of the operand length. To improve performance, frequently used storage oper- ands should be aligned on integral boundaries.


a test program should be written to confirm the bahavior of each instruction
and the proper alignment fo the relevant areas CCWs IDAWs and friends
but those of us who play around whit them are so used to proper align things
that it would require additional effort to misalign everyting

a DS 0d or DS 0f here and there never hurt anybody!

also the compiler allocation strategy for unstructured variables takes alignment into account
grande,double,full,half,byte alignment in the order
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Dec 09, 2010 7:55 pm
Reply with quote

The only instructions that you are likely to use in writing "application" code that are boundry sensitive are the COMPARE AND SWAP and COMPARE DOUBLE AND SWAP instructions.

POP says: "The second operand of COMPARE AND SWAP (CS, CSY) must be designated on a word boundary. The second operand of COMPARE AND SWAP (CSG) and COMPARE DOUBLE AND SWAP (CDS, CDSY) must be designated on a doubleword boundary. The second operand of COMPARE DOUBLE AND SWAP (CDSG) must be designated on a quadword boundary."

I only mention those instructions because they were recently mentioned in another thread as an alternative to the use of ENQ.

There are, of course, other instructions that are boundary sensitive - but they are primarily used only in systems-level programming, not application-level code. Trust me, you will know their restrictions intimately if you have a need to use them.
Back to top
View user's profile Send private message
vijay korde

New User


Joined: 19 Feb 2010
Posts: 27
Location: India

PostPosted: Thu Dec 09, 2010 8:52 pm
Reply with quote

Thank you all for the reply.
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

 


Similar Topics
Topic Forum Replies
No new posts What's mean by boundary allignment in... PL/I & Assembler 6
No new posts Copy records from selected boundary DFSORT/ICETOOL 5
No new posts is SYNC clause changes the word bound... COBOL Programming 2
No new posts comp sync word boundary COBOL Programming 1
Search our Forums:

Back to Top