On 13/04/18 15:02, Seymour J Metz wrote:
Unpacking x'0123' gives you x'F0F132'; the OI then gives you
x'F0F1F2'; what you want is x'F0F1F2F3'. Or with an UNNPK length of 4
you get x'F0F0F1F2'; still not what you want.

Suppose the byte after the X'0123' is X'xy' (where x and y are
any hex digits).

Unpacking X'0123xy' (with a source length of 3 and a destination
length of 5) gives you X'F0F1F2F3yx' which, when you drop
the last byte, gives you what you want.

This assumes that there is an addressable byte immediately after X'0123'
For a general solution, copy the source field to a sufficiently
large work area before unpacking.

--
                        Martin

Dr Martin Ward | Email: mar...@gkc.org.uk | http://www.gkc.org.uk
G.K.Chesterton site: http://www.gkc.org.uk/gkc | Erdos number: 4

Reply via email to