PIC Math HEX Scale Program Code Generator

by "Bill & Pookie"

This Code Generator produces a program that will scale a packed hexidecimal value, two bytes in size, by some specified amount, and return the result as a packed hex value.

For example, if it were set to scale by 2, then if the resulting program were given an input of 0B05 (that is 0x0B or 11 in BYHIGH and 0x05 in BYLOW) the output would be 160A (that is 0x16 or 22 in BYHIGH and 0x0A or 10 in BYLOW)

If you are starting with a hexidecimal value, this will most likely be more efficient than converting the value to binary from hex, scaling the binary value (perhaps using the Code Generator for Constant Multiplication/Division) and then converting the result back to hexidecimal.

Scale: Enter the amount to scale the value.
e.g. "3" will multiply the value by three, "0.5" will divide the value in half, and 1.66666666 would increase the value by two thirds.