by BillyBoyo » Tue Aug 16, 2011 3:49 pm
You have NUMPROC(NOPFD). The source field is unsigned. The value of SYSLIT AT +45 is X'0C'. The MVN is the method chosen in this case to ensure that the receiving field is positive, irrespective of the sign nybble (left-most four bits of the right-most byte).
I assume that you know what MVN is doing? The offset in your comp-3 field is to get at the right-most byte, and the MVN is only going to affect the right-most nybble, which is the sign for a comp-3 field.
The compiler uses MVN in that situation, not NI (which NUMPROC(PFD) would do), because NUMPROC(NOPFD) allows values of A, B, C, D, E and F in the sign (for either display-numeric or comp-3). PFD only allows C, D, and F. So for PFD an NI with X'FC' will ensure a C (positive) sign and preserve the value in the number nybble of the sign-byte (would be NI with X'CF' for display-numeric).
With NOPFD, the NI will not work if the sign happens to have A or B (it is unlikely to, but NOPFD allows it, so the compiler has to cater for it). So MVN is used as a second-best (it is slower).
The compiler option OPT has no affect on this.
You can confirm this against your listing, and by compiling with NUMPROC(PFD) is you are able to, just to see the difference.