User Tools

Site Tools


cdc:nos2.source:nam5871:msetptr

MSETPTR

Table Of Contents

  • [00005] PRGM MSETPTR
  • [00056] PROC MSETIL
  • [00057] PROC XTRACE

Source Code

MSETPTR.txt
  1. *DECK MSETPTR
  2. USETEXT NIPDEF
  3. USETEXT PIT
  4. USETEXT PRUBUFF
  5. PRGM MSETPTR; # SET BACKWARD PTRS IN PRU CHAIN#
  6. STARTIMS;
  7. #
  8. *1DC MSETPTR
  9. *
  10. * 1. PROC NAME AUTHOR DATE
  11. * MSETPTR E. GEE 85/04/02
  12. *
  13. * 2. FUNCTIONAL DESCRIPTION
  14. * SET UP BACKWARD POINTERS IN THE PRU BUFFERS FOR GARBAGE
  15. * COLLECTION.
  16. *
  17. * 3. METHOD USED
  18. * CALL MSETIL TO SET NIP/PIP INTERLOCK.
  19. * LOOP TO PROCESS EACH PIT ENTRY.
  20. * IF PIT ENTRY IN USE,
  21. * LOOP TO PROCESS EACH PRU BUFFER SIZE,
  22. * IF PRU BUFFERS EXISTS,
  23. * SET UP BACKWARD POINTERS IN THE PRU BUFFER.
  24. *
  25. * 4. ENTRY PARAMETERS
  26. * NONE
  27. *
  28. * 5. EXIT PARAMETERS
  29. * NONE
  30. *
  31. * 6. COMDECKS CALLED
  32. * NIPDEF NIP CONSTANT DEFINITIONS
  33. * PIT PIP INTERFACE TABLE
  34. * PRUBUFF PRU BUFFER TEMPLATE
  35. *
  36. * 7. ROUTINES AND OVERLAYS CALLED
  37. * MSETIL SET NIP/PIP INTERLOCK
  38. * XTRACE TRACE CALLS
  39. *
  40. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  41. *
  42. * THIS PROGRAM IS A PRIMARY OVERLAY LOADED BY SUBROUTINE OVLCALL.
  43. * WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO LOCATION RJMAIN
  44. * TO RETURN TO THE CALLING PROGRAM.
  45. *
  46. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE PRIMARY
  47. * OVERLAY BUFFER SIZE MINUS 5 (560B WORDS).
  48. *
  49. * THIS OVERLAY IS CALLED BY XEXEC.
  50. *
  51.  #
  52. STOPIMS;
  53.  
  54. XREF
  55. BEGIN
  56. PROC MSETIL; # SET NIP/PIP INTERLOCK #
  57. PROC XTRACE; # RECORD TRACES #
  58. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  59. END
  60. #
  61.   INTERNAL VARIABLES
  62. #
  63. ITEM I; # INDUCTION VARIABLE #
  64. ITEM J; # INDUCTION VARIABLE #
  65. ITEM BACKPRU; # ADDR OF PREV PRU BUF IN CHAIN #
  66. ITEM PITIDX; # PIT ENTRY INDEX #
  67.  
  68. BASED ARRAY PRUNIPWD S(1); # TEMPLATE FOR NIP WORD IN PIT #
  69. BEGIN
  70. ITEM PRUNIPMFB U(0,00,06); # MINIMUM NO OF PRU BUFS #
  71. ITEM PRUNIPMAB U(0,06,06); # MAXIMUM NO OF PRU BUFS #
  72. ITEM PRUNIPNCA U(0,12,12); # CURRENT NO OF BUFFERS ASSIGNED#
  73. ITEM PRUNIPNC U(0,24,12); # CURRENT NO OF PRU CONNECTIONS #
  74. ITEM PRUNIPFPB U(0,42,18); # ADR OF FIRST BUF IN FREE CHAIN#
  75. END
  76.  
  77. #**********************************************************************#
  78. CONTROL EJECT;
  79.  
  80. BEGIN # BEGIN MSETPTR #
  81.  
  82. CONTROL IFEQ DEBUG,1;
  83. XTRACE("MSETP");
  84. CONTROL FI;
  85.  
  86. MSETIL(0); # SET NIP/PIP INTERLOCK #
  87. FOR I = 1 STEP 1 UNTIL MAXPIP
  88. DO # PROCESS EACH PIT ENTRY #
  89. BEGIN
  90. IF PITPUF[I]
  91. THEN # PIT ENTRY IS IN USE #
  92. BEGIN
  93. P<PRUNIPWD> = LOC(PITFPB1[I]); # ADDR OF PRU BUF POINTER WORD#
  94. FOR J = 0 STEP 1 UNTIL MAXPRU-1
  95. DO # PROCESS EACH PRU BUFFER SIZE #
  96. BEGIN
  97. BACKPRU = LOC(PRUNIPFPB[J]); # ADDR OF PTR WORD IN PIT ENT#
  98. P<PRUBUFF> = PRUNIPFPB[J]; # ADDR OF 1ST PRU BUF IN CHAIN #
  99. FOR J=J WHILE P<PRUBUFF> NQ 0
  100. DO # PROCESS EACH PRU BUF IN CHAIN #
  101. BEGIN
  102. PRUBBACK[0] = BACKPRU; # SET UP BACKWARD CHAIN PTR #
  103. BACKPRU = P<PRUBUFF>; # ADDR OF THIS PRU BUFFER #
  104. P<PRUBUFF> = PRUBDLFP[0]; # ADDR OF 1ST PRU BUF IN CHAIN#
  105. END
  106. END
  107. END
  108. END
  109. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  110.  
  111. END
  112. TERM
cdc/nos2.source/nam5871/msetptr.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator