I have two pairs of encoded bits in the high order of a binary
byte. These two pairs (values of 0 to 3, each) actually represent the
numbers 1 to 4 in each case. Now, I know that I could do this the hard
(long?) way by bit-testing these and come up with the human-readable zoned
equivalents. In fact, I've already done that.
But, not only do I not like how the code looks in my program, I
also think there should be a shorter way. For example, I could insert the
byte into a register, shift out the unwanted bits, and then add 1 to get
the same numbers -- but in binary. I would then have to
convert-to-decimal and unpack or edit the numbers into zoned format.
That seems like a bit much. So, is that what I am going to have
to do? ...or stick with bit-testing? ...or is there a better way to
accomplish this?
Sincerely,
Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300
Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331
*********************************************************************************************
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please
immediately notify the sender and delete and destroy the message and all
copies. All unauthorized direct or indirect use or disclosure of this
message is strictly prohibited. No right to confidentiality or privilege
is waived or lost by any error in transmission.
*********************************************************************************************