User Tools

Site Tools


cdc:nos2.source:nam5871:dldiso

DLDISO

Table Of Contents

  • [00002] PROC DLDISO(FIELD,LENGTH,CHARWD)

Source Code

DLDISO.txt
  1. *DECK DLDISO
  2. PROC DLDISO(FIELD,LENGTH,CHARWD);
  3. *IF DEF,IMS
  4. #
  5. *
  6. * 1. PROC NAME AUTHOR DATE.
  7. * DLDISO S.KRULEVITCH 79/01/04
  8. *
  9. * 2. FUNCTIONAL DESCRIPTION.
  10. * CONVERT AN OCTAL NUMBER TO DISPLAY CODE
  11. *
  12. * 3. METHOD USED.
  13. * A RIGHT JUSTIFIED OCTAL NUMBER IS CONVERTED DIGIT
  14. * BY DIGIT TO A LEFT JUSTIFIED CHARACTER ITEM.
  15. * UP TO 20 OCTAL DIGITS MAY BE CONVERTED.
  16. *
  17. * 4. ENTRY PARAMETERS.
  18. * FIELD - A WORD CONTAINING THE OCTAL NUMBER IN
  19. * RIGHT MOST BITS.
  20. * LENGTH - THE NUMBER OF OCTAL DIGITS TO BE CONVERTED
  21. *
  22. * 5. EXIT PARAMETER.
  23. * CHARWD - CHARACTER WORD LEFT JUSTIFIED.
  24. *
  25. * 6. COMDECKS CALLED.
  26. * NONE.
  27. *
  28. * 7. ROUTINES CALLED.
  29. * NONE.
  30. *
  31. * 8. DAYFILE MESSAGES.
  32. * NONE.
  33. *
  34.  #
  35. *ENDIF
  36. BEGIN
  37. #
  38.   INPUT PARAMETERS
  39. #
  40. ITEM FIELD U; # OCTAL NUMBER TO BE CONVERTED #
  41. ITEM LENGTH I; # NUMBER OF OCTAL DIGITS #
  42. #
  43.   OUTPUT PARAMETER
  44. #
  45. ITEM CHARWD C(20); # DISPLAY CODE WORD #
  46. #
  47.   LOCAL VARIABLES
  48. #
  49. DEF OCTL # 3 #; # OCTAL DIGIT LENGTH IN BITS #
  50. ITEM A; # TEMPORARY VARIABLE #
  51. ITEM B; # TEMPORARY VARIABLE #
  52. # OCTAL TO DISPLAY CONVERSION #
  53. ITEM OCTC C(8) = "01234567";
  54. ITEM OCTAL; # 3 BIT OCTAL DIGIT #
  55. ITEM I; # DO LOOP INDUCTION VARIABLE #
  56. ITEM J; # INDEX #
  57. #**********************************************************************#
  58. #
  59.   OCTAL TO DISPLAY CODE CONVERSION
  60. #
  61. J = 0;
  62. CHARWD = " ";
  63. A = 20 - LENGTH;
  64. FOR I = A STEP 1 UNTIL 19 DO
  65. BEGIN
  66. OCTAL = B<I*OCTL,OCTL> FIELD;
  67. C<J,1> CHARWD = C<OCTAL> OCTC;
  68. J = J + 1;
  69. END
  70. END # DLDISO #
  71. TERM
cdc/nos2.source/nam5871/dldiso.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator