User Tools

Site Tools


cdc:nos2.source:nam5871:dldisde

DLDISDE

Table Of Contents

  • [00003] PROC DLDISDE(BINAR, REXTENT, RESULT)

Source Code

DLDISDE.txt
  1. *DECK DLDISDE
  2. USETEXT DLFPDEF
  3. PROC DLDISDE(BINAR, REXTENT, RESULT);# CONVERT BINARY TO DISPLAY #
  4.  
  5. *IF DEF,IMS
  6. #
  7. *1DC DLDISDE
  8. *
  9. * 1. PROC NAME AUTHOR DATE
  10. * DLDISDE P.C.TAM 78/10/05
  11. *
  12. * 2. FUNCTIONAL DESCRIPTION.
  13. * CONVERT BINARY TO DISPLAY DECIMAL.
  14. *
  15. * 3. METHOD USED.
  16. * ADD 33B TO EACH DIGIT TO CONVERT IT INTO DISPLAY CODE
  17. *
  18. * 4. ENTRY PARAMETERS.
  19. * BINAR BINARY NUMBER TO BE CONVERTED
  20. * REXTENT NO OF DIGITS NEEDED (MUST BE LQ 10)
  21. *
  22. * 5. EXIT PARAMETERS.
  23. * RESULT CALCULATED RESULT
  24. *
  25. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  26. * DLFPDEF
  27. *
  28. * 7. ROUTINES CALLED.
  29. * NONE.
  30. *
  31. * 8. DAYFILE MESSAGES.
  32. * NONE.
  33. *
  34.  #
  35. *ENDIF
  36. #
  37.   EXTERNAL VARIABLES
  38. #
  39. #
  40.   INTERNAL VARIABLES
  41. #
  42. ITEM
  43. BINAR I, # BINARY NO TO BE CONVERTED #
  44. REXTENT I, # LENGTH OF FIELD #
  45. RESULT C(WC), # RESULT #
  46. TEMP1 I, # TEMPORARY VARIABLE #
  47. TEMP2 I, # TEMPORARY VARIABLE #
  48. TEMP9 C(WC), # TEMPORARY VARIABLE #
  49. I I; # TEMPORARY VARIABLE #
  50.  
  51. # ******************************************************************** #
  52.  
  53. BEGIN
  54. TEMP1 = BINAR;
  55. FOR I = 0 STEP 1 UNTIL WC - 1
  56. DO
  57. BEGIN
  58. TEMP2 = TEMP1 / 10;
  59. B<54 - I * CL, CL> TEMP9 = TEMP1 - TEMP2 * 10 + O"33";
  60. TEMP1 = TEMP2;
  61. END
  62. RESULT = C<WC - REXTENT, REXTENT>TEMP9;
  63. END
  64. TERM
cdc/nos2.source/nam5871/dldisde.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator