From: "Martin Ward" <mar...@gkc.org.uk>
Sent: Saturday, April 14, 2018 12:13 AM


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.

I was wondering when someone would come up with this.

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.

For a general solution, just use UNPK as above,
and define a byte following the source.

If this is not possible, then move the 2 bytes.

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply via email to