!Revision history:
! 000 19-Jun-88 PSR Created

%externalstring(15)%fn XtoS %alias "3L_IMP_X_TO_S"(%integer N, M)
   %integer J, S
   %string(15) X = ""
   %if M > 0 %start
      M = 8 %if M > 8
      %for J = M, -1, 1 %cycle
         S = (N>>(4*(J-1)))&15
         %if S > 9 %then S = S-10+'A' %else S = S+'0'
         X = X.Tostring(S)
      %repeat
   %finish
   %result = X
%end

%externalroutine Print Hex %alias "3L_IMP_PRINT_HEX"(%integer N, P)
   Printstring(XtoS(N, P))
%end
