You only defined the second constant as 13 bytes, but are attempting to move 21 bytes. (unlike the first constant, the second was not defined with a (CL21) length qualifier, hence was implicitly defined as only 13 bytes in length).
If you look at the expansion of your program, you will likely find that the second literal was the last literal generated and starts fewer than 21 bytes before the end of your program - hence, attempting to move 21 bytes when there are fewer than 21 left in your addressable space results in an S0C4 abend (an addressing exception ).
Out of curiosity - if the SECOND MVC causes a S0C4, how can you say that the THIRD MVC works?
As an aside, writing messages to the console operator (ROUTCDE=2) is usually frowned upon, unless there is a darned good reason to do so. Better to use ROUTCDE=11 and just post the messages to the jes message log.
What you said looks correct to me but again my query is -
If I comment out second MVC and try to run the program only with first and third MVC, it is working fine with maxcc=0. However the difference between second and third MVC is only FLD3+2(21) is replaced by FLD3+2(20). Except this all othere things are same and program is running fine.
Joined: 06 Jun 2008 Posts: 8165 Location: East Dubuque, Illinois, USA
However the difference between second and third MVC is only FLD3+2(21) is replaced by FLD3+2(20).
What you say here is not true -- because there is a sending field AND a receiving field in the MVC instruction. You realize that the S0C4 abend is due to the SENDING field, not the receiving field, right? If you used an LTORG before FLD3, you would not get any abend at all -- unless you exceed the 4095 byte addressing limit on your base register.
The literal pool is populated as governed by the below rules(See This):
Each literal pool has five segments into which the literals are stored
(a) in the order that the literals are specified, and
(b) according to their assembled lengths, which, for each literal, is the total explicit or implied length, as described below.
1) The first segment contains all literal constants whose assembled lengths are a multiple of 16.
2) The second segment contains those whose assembled lengths are a multiple of 8, but not of 16.
3) The third segment contains those whose assembled lengths are a multiple of 4, but not a multiple of 8.
4) The fourth segment contains those whose assembled lengths are even, but not a multiple of 4.
5 )The fifth segment contains all the remaining literal constants whose assembled lengths are odd.
As evident from the rules, the first literal in the pool should be =C'NEGATIVE MOVE$' as per rule #4.
The last literal should be =C'NEGATIVE MOVE' as per rule #5.
Hence the second MVC in the original program(which is referencing last literal) will indeed produce a storage exception.