IBM Mainframe Assembler List <[email protected]> wrote on 07/16/2014 09:33:56 AM:
> From: John Gilmore <[email protected]> > The example on page 39 of Appendix A of the current PrOp that > unconditionally puts a '$' before the first result digit can be > modified trivially to put '-' before it iff the unedited packed value > is negative. (Subtract 0 from the packed value and test the resulting > condition code to determine whether it is negative.) > I am assuming here that you want to print only negative signs, > instances of '-'., for a packed vsazlue p < 0.0. If you want a > floating prefixed sign, either of '-' or '+', you can do that too; but > the code following the EDMK is slightly more complex. If you want to > deal with this more complex case, you need to decide what to do with > zero values. The tradition is usually to make them positive, but you > could instead elect to use a blank 'sign character' for zero values. Note EDMK sets the condition code so you need only test it with a condition branch/jump after the edit. Note the simple floating edit example can be found in QW if you have access to it. LA R1,PWORK+5 EDMK PWORK,WORK BCTR R1,0 MVI 0(R1),C'$' The result in printable form is; $6,456 1st operand - PWORK DC X'4020206B212020' 2nd operand - WORK DC P'6,456' WORK looks like this in packed format: 06456C ----------------------------------------- The information contained in this communication (including any attachments hereto) is confidential and is intended solely for the personal and confidential use of the individual or entity to whom it is addressed. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this communication in error and that any review, dissemination, copying, or unauthorized use of this information, or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. Thank you
