User Tools

Site Tools


cdc:nos2.source:nam5871:np_8tin

NP$8TIN

Table Of Contents

  • [00012] PROC NP$8TIN(NPASCWD,INTVALUE)

Source Code

NP$8TIN.txt
  1. *DECK NP$8TIN
  2. *IF,DEF,XFR
  3. USETEXT NX$ACBF
  4. USETEXT AIPDEF
  5. USETEXT HEADER
  6. USETEXT NP$STAT
  7. USETEXT NP$DB
  8. USETEXT NP$NWL
  9. USETEXT NP$MODE
  10. USETEXT NP$GETS
  11. USETEXT NX$ACBX
  12. PROC NP$8TIN(NPASCWD,INTVALUE);
  13. BEGIN
  14. #
  15. **
  16. * 1. PROC NAME AUTHOR DATE
  17. *
  18. * NP$8TIN Y. C. YIP 02/16/1984
  19. *
  20. * 2. FUNCTIONAL DESCRIPTION.
  21. *
  22. * NP$8TIN PICKS UP THE DD VALUE IN ASCII REPRESENTATION
  23. * AND RETURN THE INTEGER VALUE OF THE CHECKMARK TO INTVALUE.
  24. *
  25. * 3. METHOD USED.
  26. *
  27. * NP$8TIN LOOPS AROUND THE DD FIELDS STARTING FROM THE
  28. * LAST DD FIELD. IT PICKS UP THE ASCII VALUE, SUBTRACT
  29. * ASCII VALUE 0 FROM IT TO GET THE ACTUAL NUMERICAL VALUE
  30. * WORD OFFSET OF THE CURRENT PRU. DBIT IS ONLY USED BY THE
  31. * RESULT TO IT.
  32. *
  33. * 4. ENTRY CONDITIONS:
  34. *
  35. * NPASCWD = WORD CONTAINING THE DD
  36. * INTVALUE = RETURN PARAMETER
  37. *
  38. *
  39. * 5. EXIT CONDITIONS:
  40. *
  41. * INTVALUE HAS THE CHECKMARK NUMBER.
  42. * NPASCWD IS UNCHANGED
  43. #
  44. #
  45. ****
  46. #
  47. XREF
  48. BEGIN
  49. END
  50. #
  51. ****
  52. #
  53. ITEM NPASCWD; # WORD CONTAINING THE ASCII DD#
  54. ITEM INTVALUE; # PARAMETER THAT RETURNS THE #
  55. ITEM TEMP; # INTEGER TEMPORARY #
  56. ITEM EXPONENT; # POWER OF TEN #
  57. ITEM INDEX; # LOOP INDEX #
  58. CONTROL EJECT;
  59. #
  60. ************************************************************************
  61. * *
  62. * CODE OF NP$8TIN BEGINS HERE *
  63. * *
  64. ************************************************************************
  65. #
  66. EXPONENT = 1; # START WITH 1 #
  67. INTVALUE = 0; # INTIALIZE INTVALUE #
  68. FOR INDEX = DDEND STEP -BYTE$SIZE UNTIL DDSTART
  69. DO
  70. BEGIN
  71. TEMP = B<INDEX,BYTE$SIZE>NPASCWD; # GET THE ASCII VALUE #
  72. TEMP = TEMP - ASCII$ZERO;
  73. TEMP = TEMP*EXPONENT; # CALCULATE CHECKMARK VALUE #
  74. INTVALUE = TEMP + INTVALUE;
  75. EXPONENT = EXPONENT*10;
  76. END
  77. RETURN; # RETURN TO CALLER #
  78. END # END OF PROC NP$8TIN #
  79. TERM
  80. *ENDIF
cdc/nos2.source/nam5871/np_8tin.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator