User Tools

Site Tools


cdc:nos2.source:nam5871:nxdcb

Table of Contents

NXDCB

Table Of Contents

  • [00003] PROC NXDCB(DCWORD,BINWORD,ERROR)

Source Code

NXDCB.txt
  1. *DECK NXDCB
  2. USETEXT NIPDEF
  3. PROC NXDCB(DCWORD,BINWORD,ERROR); # CONVERT DISPLAY CODE TO BINARY #
  4. STARTIMS;
  5. #
  6. *1DC NXDCB
  7. *
  8. * 1. PROC NAME AUTHOR DATE
  9. * NXDCB C. BITTNER 83/04/01
  10. *
  11. * 2. FUNCTIONAL DESCRIPTION
  12. * THIS PROCEDURE CONVERTS A DISPLAY CODE NUMBER TO
  13. * BINARY FORMAT.
  14. *
  15. * 3. METHOD USED
  16. * VALIDATE EACH DIGIT - CHECK IF IN RANGE BETWEEN
  17. * 0 AND 9. IF O"00" FOUND - WHOLE NUMBER HAS BEEN
  18. * CONVERTED, ELSE MASK IN THE DIGIT INTO THE
  19. * BINARY WORD.
  20. *
  21. * 4. ENTRY PARAMETERS
  22. * DCWORD - DISPLAY CODE NUMBER
  23. *
  24. * 5. EXIT PARAMETERS
  25. * BINWORD - OUTPUT WORD IN BINARY
  26. * ERROR - ERROR IN PARAMETER FLAG
  27. *
  28. * 6. COMDECKS CALLED AND SYMPL TEXTS USED
  29. * NIPDEF
  30. *
  31. * 7. ROUTINES CALLED
  32. * XTRACE - TRACE PROCEDURE CALL
  33. *
  34. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  35. * NONE
  36. *
  37.  #
  38. STOPIMS;
  39.  
  40. #
  41.   INPUT PARAMETERS
  42. #
  43. ITEM DCWORD U; # DISPLAY CODE WORD #
  44.  
  45. #
  46.   OUTPUT PARAMETERS
  47. #
  48. ITEM BINWORD I; # OUTPUT WORD IN BINARY #
  49. ITEM ERROR B; # ERROR IN PARAMETER FLAG #
  50. ITEM DONE B; # DONE FLAG - LAST DIGIT CONVERTED #
  51.  
  52. #
  53.   EXTERNAL VARIABLES
  54. #
  55. XREF PROC XTRACE; # TRACE PROCEDURE CALL #
  56.  
  57. #
  58.   INTERNAL VARIABLES
  59. #
  60. ITEM NUM I; # DISPLAY CODE DIGIT #
  61. ITEM J; # LOOP PARAMETER #
  62.  
  63. BEGIN
  64.  
  65. CONTROL IFEQ DEBUG,1;
  66. XTRACE("NXDCB");
  67. CONTROL FI;
  68.  
  69. BINWORD = 0;
  70. DONE = FALSE;
  71. ERROR = FALSE;
  72. FOR J=0 STEP 1 WHILE J LS WC AND NOT ERROR AND NOT DONE
  73. DO
  74. BEGIN
  75. NUM = C<J,1>DCWORD;
  76. IF (NUM GQ O"33" AND NUM LQ O"44" )
  77. THEN
  78. BEGIN
  79. BINWORD = (BINWORD * 10) + (NUM - O"33");
  80. END
  81. ELSE
  82. IF NUM EQ O"00"
  83. THEN
  84. DONE = TRUE;
  85. ELSE
  86. ERROR = TRUE;
  87. END
  88. END
  89. TERM
cdc/nos2.source/nam5871/nxdcb.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator