Need to be very careful here, and I'm suspicious because testing that bottom bit is counter-intuitive, and different from what I would expect.

I've tried reading through the documentation that I can find (e.g., http://pic.dhe.ibm.com/infocenter/zos/v1r12/index.jsp?topic=%2Fcom.ibm.zos.r12.idad400%2Fd4356.htm) and 
I think you are testing the wrong bit..

Because the original is bigendian I think bit 0 would be referring to the top bit of the 4 byte value you have read.

So I *think* the code should be
if (bwd & 0x80000000)
   bwd &= 0x7fffffff;
else
   bwd >>=16;

Also, do we have some examples that we can use to check we have implemented it correctly?

@johnholt can you help clarify?