All
I’ve updated the problem
statement for #13 per posting on Mainframe Assembler List indicating it was
incorrect. I’ve also posted a new solution to #13 using 7 DFP
instructions to perform the required division and rounding to 2 decimal
places. Calculating the number of significant digits to request for
rounding to 2 decimal places was not exactly trivial since the division
produced an irrational fraction with repeating sequence of 270270… which
resulted in 16 significant digit result with corresponding exponent set to
required position versus preferred position. Visit the web site to see
source and log listings:
http://z390.sourceforge.net/z390_Mainframe_Assemble_Coding_Contest.htm
Note running this solution on z390
requires update to PTF level v1400a which can now be downloaded in
InstallShield format for easy installation from www.z390.org.
This PTF fixes trap in RRDTR and RRXTR under some conditions and includes
trailing zeros as significant digits in ESDTR and ESXTR instructions.
Also the traces for several DFP instructions have been corrected to show
correct GPR versus FPR registers.
Although figuring out how to do
this in DFP was fun, I don’t recommend changing existing PD routines like
Steve’s P13SC1.MLC unless there is a well defined business application
requirement such as the need for an industry standard method that can be used
on different hardware and software platforms producing exactly the same result.
Don Higgins
mailto:don@...
http://don.higgins.net