Am 11.02.2022 um 23:03 schrieb Dave Clark:
         How do (can?) you EXecute a ZAP instruction?  I have a packed
number in plain character format that can vary in length from 1 to 16
bytes.  I need to move that into a 16-byte formal packed work field in
order to make the variable-length character data into recognizable
packed-decimal data.


Sorry for jumping into this thread so late -

if the source number is in char format and the target is packed,
you should use PACK, not ZAP

The "skeleton instruction" for EX looks like this

SKEL   PACK TARGET(16),SOURCE(0)

that is, it (internally) has length bytes 15 and zero (external L2 of zero
translates to zero, same as external L2 of one; but zero looks better,
showing that the real length will come from EX).

then you put the real length into a register, say R3, like this:

   LA   R3,length
   BCTR R3,0     subtract 1 from R3
   EX R3,SKEL

EX combines the content of R3 with the second byte of the skeleton instruction
using OR (it does not "replace" it, as you write below).

HTH

Kind regards

Bernd



         The normal EXecute (ORs but effectively) replaces bits 8 to 15 of
the target instruction with bits 56 to 63 of general register R1.  But a
ZAP instruction has an L1 field in bits 8 to 11 of the instruction and an
L2 field in bits 12 to 15 of the instruction.

         Does that mean ZAP can't be EXecuted?  Do I have to clear and
align my variable-length character data in my 16-byte packed work field
myself?  Or is it feasible to manipulate the content of general register
R1 so that bits 56 to 63 contain the correct L1 and L2 values?

Sincerely,

Dave Clark

Reply via email to