Here is an ugly direct implementation of the algorithm.
The function (input: integer; output: string):
](filedata/fetch?id=1785697&d=1594216431)The macro *GetHexDigit *to map {1,2,…,15} → {1,2,…,F}:
](filedata/fetch?id=1785695&d=1594215978)Usage:
](filedata/fetch?id=1785694&d=1594215978)
Result:
123456789 -> 75BCD15