It looks like if we change the "S9(9)"s to "9(9)"s the ZAP goes away
and an Or-Immediate is added.  This Or-Immediate is unnecessary (it
operates on one of the "garbage" bytes) but it is harmless.  My POPs
also says that the second operand is checked for valid =digit= codes,
as well as valid sign.  So, the ZAP had to go.

       IDENTIFICATION DIVISION.
       PROGRAM-ID. TEST01.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  WS-HEXWORK-AREA.
           05  WS-HEX-INPUT-AREA.
               10  WS-HEX-INPUT-ARG    PIC X(4).
               10  FILLER              PIC X.
           05  WS-HEX-INPUT-COMP3      REDEFINES WS-HEX-INPUT-AREA
                                       PIC 9(9) COMP-3.
           05  WS-HEX-OUTPUT-AREA.
               10  WS-HEX-OUTPUT       PIC X(8).
               10  FILLER              PIC X.
           05  WS-HEX-OUTPUT-DISPLAY   REDEFINES WS-HEX-OUTPUT-AREA
                                       PIC 9(9).
       PROCEDURE DIVISION.
           MOVE WS-HEX-INPUT-COMP3 TO WS-HEX-OUTPUT-DISPLAY.
           INSPECT WS-HEX-OUTPUT CONVERTING
                          X'FAFBFCFDFEFF' TO 'ABDCEF'.
           GOBACK.


...
 000018  MOVE
    000322  5820 912C               L     2,300(0,9)              BLW=0
    000326  F384 2005 2000          UNPK  5(9,2),0(5,2)           
WS-HEX-OUTPUT-DISPLAY             WS-HEX-INPUT-COMP3
    00032C  96F0 200D               OI    13(2),X'F0'             
WS-HEX-OUTPUT-DISPLAY+8
 000019  INSPECT
    000330  DC07 2005 A016          TR    5(8,2),22(10)           WS-HEX-OUTPUT 
                    PGMLIT AT +18
...



At 09:11 AM 11/23/2005, Chase, John wrote:
  
>[...snip]
>It just occurred to me that the ZAP instruction generated for the COBOL
>MOVE statement could lead to S0C7s, so I checked the PoPs manual:
>
>"Only the second operand is checked for valid sign and digit codes."
>
>What's significant here is that the second operand IS checked.
>
>Suppose the "second operand" (WS-HEX-INPUT-ARG) is initially the SNA
>sense code x'087D0001'.  The fact that it's redefined as a COBOL COMP-3
>field does not make it so.  I believe the ZAP in this instance would
>"choke" on the 'D' in the middle of the "number".
>
>What's needed here is a means to generate the UNPK instruction without
>the ZAP, and I can't think of any....




==================================================
Art Celestini       Celestini Development Services
Phone: 201-670-1674                    Wyckoff, NJ
=============  http://celestini.com  =============
Mail sent to the "From" address  used in this post
will be rejected by our server.   Please send off-
list email to:  ibmmain<at-sign>celestini<dot>com.
==================================================

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to