User Tools

Site Tools


cdc:nos2.source:nam5871:np_upru

NP$UPRU

Table Of Contents

  • [00012] PROC NP$UPRU(OLDPTR,NEWPTR)

Source Code

NP$UPRU.txt
  1. *DECK,NP$UPRU
  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$UPRU(OLDPTR,NEWPTR);
  13. BEGIN
  14. #
  15. **
  16. * 1. PROC NAME AUTHOR DATE
  17. *
  18. * NP$UPRU Y. C. YIP 02/16/1984
  19. *
  20. * 2. FUNCTIONAL DESCRIPTION.
  21. *
  22. * NP$UPRU UPDATES THE CURRENT INFORMATION POSITION IN
  23. * THE DISK FET FOR BOTH SENDER AND RECEIVER.
  24. *
  25. * 3. METHOD USED.
  26. *
  27. * THE CURRENT INFORMATION IN THE DISK FET IS DETERMINED
  28. * BY THE PRU NUMBER, WORD OFFSET WITHIN THE PRU NUMBER
  29. * AND THE DBIT THAT IS THE NEXT USABLE BIT POSITION IN THE
  30. * WORD OFFSET OF THE CURRENT PRU. DBIT IS ONLY USED BY THE
  31. * TRANSLATION SERVICE.
  32. *
  33. * FTT PRU IS COMPUTED BY THE CALCULATING THE DIFFERENCE
  34. * OF THE NEWPTR AND THE OLDPTR WHICH ARE INPUT PARAMETERS
  35. * USING THE FOLLOWING METHOD:
  36. * FTTCURPRU = FTTCURPRU + (NEWPTR - OLDPTR)/64
  37. * WORD-OFFSET = REMAINDER OF (NEWPTR - OLDPTR)/64
  38. * FTTDBIT = DBIT FROM CHARACTER MODE BUFFER
  39. *
  40. * 4. ENTRY CONDITIONS:
  41. *
  42. * NEWPTR = VALUE OF POINTER IN THE DISKFET.
  43. * OLDPTR = VALUE OF OLDPOINTER IN THE DISKFET.
  44. *
  45. *
  46. * 5. EXIT CONDITIONS:
  47. *
  48. * NEWPTR AND OLDPTR ARE NOT CHANGED.
  49. * FTTCURPRU, FTTWORD, AND FTTDBIT GET UPDATED.
  50. *
  51. *
  52. #
  53. ITEM WORDSKIP; # DIFFERENCE BETWEEN NEWPTR AND
  54.   OLDPTR
  55.   #
  56. ITEM OLDPTR; # VALUE OF THE PREVIOUS PTR #
  57. ITEM NEWPTR; # VALUE OF THE NEWPTR #
  58. ITEM PRUEXCESS; # INCREMENT IN PRU NUMBER #
  59.  
  60. CONTROL EJECT;
  61. #
  62. ************************************************************************
  63. * *
  64. * CODE OF NP$UPRU BEGINS HERE *
  65. * *
  66. ************************************************************************
  67. #
  68. P<FET$CIO> = FTTFETADR[FTTINDEX]; # PULL DISKFET TEMPLATE TO
  69.   FET ADDRESS IN FTT #
  70. P<CMB> = FTTCMV$BLK[FTTINDEX]; # PULL CMB TEMPLATE TO #
  71. # CMB ADDRESS IN FTT #
  72. WORDSKIP = NEWPTR - OLDPTR; # CALCULATE DIFFERENCE IN WORD#
  73.  
  74. IF WORDSKIP LS 0 # FET PPINTERS ALREADY WRAPPED#
  75. THEN # AROUND #
  76. BEGIN
  77. WORDSKIP = WORDSKIP + FETLIM[0] - FETFIR[0];
  78. END # ADD THE FULL BUFFER SIZE #
  79. FTTWORD[FTTINDEX] = FTTWORD[FTTINDEX] + WORDSKIP;
  80. # CALCULATE NEW WORD #
  81. PRUEXCESS = FTTWORD[FTTINDEX]/64; # GET NEW PRU NUMBER #
  82. IF PRUEXCESS GR 0 # PRU INCREMENTED #
  83. THEN
  84. BEGIN
  85. FTTCURPRU[FTTINDEX] =
  86. FTTCURPRU[FTTINDEX] + PRUEXCESS; # UPDATE FTTCURPRU #
  87. FTTWORD[FTTINDEX] = FTTWORD[FTTINDEX] - PRUEXCESS*64;
  88. # UPDATE FTTWORD #
  89. END
  90. FTTDBIT[FTTINDEX] = CMB$DBIT[0]; # UPDATE DBIT FROM CMB #
  91. FTTMSTATE[FTTINDEX] = CMB$STATE[0]; # STORE LAST STATE OF #
  92. # TRANSLATION #
  93. IF FTTOPCODE[FTTINDEX] EQ SEND # FOR SENDER #
  94. THEN
  95. BEGIN
  96. IF CMB$DBUF[0] EQ 1 AND FTTEOR[FTTINDEX] # IF DISK BUFFER #
  97. # EMPTY AND EOR #
  98. THEN
  99. BEGIN
  100. IF (NOT FTTEOI[FTTINDEX]) OR # NOT EOI #
  101. (FTTEOI[FTTINDEX] AND
  102. ((NEWPTR NQ OLDPTR) OR (CMB$DBIT[0] NQ CMB$STEP[0])))
  103. THEN # OR EOI AND THERE IS NOTHING #
  104. BEGIN # IN THE DISK BUFFER #
  105. FTTCURPRU[FTTINDEX] = FTTCURPRU[FTTINDEX] + 1; # 1 PRU FOR#
  106. # EOR OR EOF #
  107. FTTWORD[FTTINDEX] = 0; # INITIALIZE WORD COUNT TO 0 #
  108. FTTDBIT[FTTINDEX] = CMB$STEP[0];
  109. FTTMSTATE[0] = 0; # CLEAR STATE OF TRANSLATION #
  110. END
  111. END
  112. END
  113. ELSE
  114. BEGIN # RECEIVER #
  115. IF CMB$NBUF[0] NQ 0 AND TBH$EOR[0]
  116. THEN # NETBUF EMPTY AND EORI #
  117. BEGIN
  118. IF (NOT TBH$EOI[0]) OR # NOT EOI #
  119. (TBH$EOI[0] AND
  120. ((NEWPTR NQ OLDPTR) OR
  121. (CMB$DBIT[0] NQ WORDLENGTH - CMB$STEP[0])))
  122. THEN # OR EOI AND NOTHING IN THE #
  123. BEGIN # THE DISK NUFFER #
  124. FTTCURPRU[FTTINDEX] = FTTCURPRU[FTTINDEX] + 1;
  125. FTTWORD[FTTINDEX] = 0; # INITIALIZE WORD COUNT TO 0 #
  126. FTTDBIT[FTTINDEX] = WORDLENGTH - CMB$STEP[0];
  127. FTTMSTATE[0] = 0; # CLEAR STATE OF CONVERSION #
  128. END
  129. END
  130. END
  131. RETURN; # RETURN TO CALLER #
  132. END # END OF PROC NP$UPRU #
  133. TERM
  134. *ENDIF
cdc/nos2.source/nam5871/np_upru.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator