Joined: 23 Nov 2006 Posts: 9187 Location: 221 B Baker St
Hello,
Quote:
if u force the value 21 to store in to variable ABCD the value get truncated
This is incorrect (or at least mis-understood in terms of the request). The request is how to "move" an x'21' (perfectly valid in one byte) to 2 bytes that contain x'F2F1' or 21.
Quote:
and i guess hexadecimal of numeric 21 is 2B.
Has nothing to do with the request.
One way is to define an array of 2-byte entries of all of the values from x'00' to x'FF' and then use the single byte as the displacement into the array.
If i remember, someone also posted a way to "calculate" this and a search in the forum could find it.