Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hi,
I assume the input is a string representing an unsigned 16 bit value. (But maybe the input is just two bytes binary, that is the same a 4 x 4bit hex nibbles. Clarify this)
"0x" just means that the folowing is HEX coded. It could be used to validate the string.
Now you want a decimal value...in what format?
3 bytes as 6 BCD nibbles?
6 bytes of ASCII string? With or without trailing zeroes?
For 5 x BCD you could do this one:
Subtract (decimal) 10000 as long as the result is not negative.
Count the loops and store the value in the most significantBCD nibble
Then use 1000 and the next BCD nibble
Then use 100
Then use 10
Then store the rest in the least significant BCD nibble.
Klaus