For my new game, I need a way to convert a two-byte unsigned integer value into an array of byte values where each array item represents one decimal digit.
So, if this is my variable:
static uint number = 24680;
then the converted array (byte numberArray[5]) shall have these values:
numberArray[0] == 2
numberArray[1] == 4
numberArray[2] == 6
numberArray[3] == 8
numberArray[4] == 0
If it's faster and easier to calculate, this would also work:
numberArray[0] == 0
numberArray[1] == 8
numberArray[2] == 6
numberArray[3] == 4
numberArray[4] == 2
Which is the fastest way to do this in Assembly? Is there any established best method for it?
So, if this is my variable:
static uint number = 24680;
then the converted array (byte numberArray[5]) shall have these values:
numberArray[0] == 2
numberArray[1] == 4
numberArray[2] == 6
numberArray[3] == 8
numberArray[4] == 0
If it's faster and easier to calculate, this would also work:
numberArray[0] == 0
numberArray[1] == 8
numberArray[2] == 6
numberArray[3] == 4
numberArray[4] == 2
Which is the fastest way to do this in Assembly? Is there any established best method for it?