User Tools

Site Tools


cdc:nos2.source:nam5871:np_putf

NP$PUTF

Table Of Contents

  • [00007] PROC NP$PUTF

Source Code

NP$PUTF.txt
  1. *DECK NP$PUTF
  2. USETEXT AIPDEF
  3. USETEXT NP$GETS
  4. USETEXT NP$NWL
  5. USETEXT NP$PUTS
  6. USETEXT NP$TAA
  7. PROC NP$PUTF;
  8. *IF DEF,IMS
  9. #
  10. *1DC NP$PUTF
  11. *
  12. * 1. PROC NAME AUTHOR DATE
  13. * NP$PUTF J.C. LEE 78/10/10
  14. *
  15. * 2. FUNCTIONAL DESCRIPTION
  16. * THIS ROUTINE IS CALLED BY NP$PUT TO BUILD A PUTF REQUEST IN
  17. * THE WORKLIST AND SEND THE WORKLIST TO NIP WHEN APPROPRIATE.
  18. *
  19. * 3. METHOD USED
  20. * FORMAT A NETPUTF ENTRY IN THE WORKLIST. THERE ARE THREE CASES:
  21. * CASE 1: THE MESSAGE TEXT FITS IN THE WORKLIST - A NETPUT
  22. * REQUEST IS FORMATTED IN THE WORKLIST. THE MESSAGE TEXT IS
  23. * COPIED FROM THE TEXT AREAS TO THE WORKLIST. THE WORKLIST NEED
  24. * ONLY BE SENT TO NIP IF IT IS FULL OR IF THE MESSAGE IS A
  25. * SUPERVISORY MESSAGE.
  26. * CASE 2: THE MESSAGE TEXT DOES NOT FIT INTO THE WORKLIST BUT
  27. * TAA (TEXT AREA ARRAY) DOES - A NETPUTF ENTRY IS FORMATTED IN
  28. * THE WORKLIST WITH A NONZERO TAA. THE TEXT ARRAY IS COPIED
  29. * TO THE WORKLIST. THE WORKLIST IS THEN SENT TO NIP.
  30. * CASE 3: NEITHER THE MESSAGE TEXT NOR THE TEXT AREA ARRAY
  31. * CAN FIT INTO THE WORKLIST - A NETPUTF ENTRY IS FORMATTED IN
  32. * THE WORKLIST WITH NONZERO TA AND TAA. THE WORKLIST IS THEN
  33. * SENT TO NIP.
  34. *
  35. * 4. ENTRY CONDITIONS
  36. * ACLN - NUMBER OF FRAGMENTED BUFFERS
  37. * LOC$HA - ADDRESS OF HEADER AREA
  38. * LOC$TA - ADDRESS OF TEXT AREA ARRAY
  39. * NEXT - NEXT AVAILABLE SPACE POINTER IN WORKLIST
  40. * SPACE$LEFT - NUMBER OF AVAILBLE WORKLIST CELLS
  41. *
  42. * 5. EXIT CONDITIONS
  43. * NEXT - UPDATED TO NEXT AVAILABLE SPACE POINTER IF NWL NOT SENT
  44. * SPACE$LEFT - NUMBER OF WORKLIST CELLS AVAILABLE IF NWL NOT SENT
  45. *
  46. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  47. * AIPDEF NP$CRT NP$GETS NP$NWL
  48. * NP$PUTS NP$TAA
  49. *
  50. * 7. ROUTINES CALLED
  51. * NONE
  52. *
  53. * 8. DAYFILE MESSAGES
  54. * NONE
  55. *
  56.  #
  57. *ENDIF
  58. BEGIN
  59. *CALL NP$CRT
  60. #
  61.   LOCAL VARIABLES
  62. #
  63. ITEM
  64. K I, # TEMPORARY VARIBLE #
  65. L I, # TEMPORARY VARIABLE #
  66. NAA I, # SET TO NO OF FRAGMENTS #
  67. WR I; # WORDS REMAINING IN TEXT #
  68.  
  69. BASED ARRAY MEM P(1);
  70. ITEM MEMWORD I;
  71. #**********************************************************************#
  72. #
  73.   NP$PUTF EXECUTION BEGINS HERE
  74. #
  75. NAA = ACLN; # NO OF FRAGMENTED BUFFERS #
  76. IF NAA GR MAXNA OR NAA LQ 0
  77. THEN
  78. NAA = MAXNA + 1; # NIP WILL SEND ERR/LGL #
  79.  
  80. IF TLW LQ (SPACE$LEFT - GMMESIZE - NXTSIZE) AND (NAA LQ MAXNA)
  81. THEN
  82.  
  83. BEGIN # ROOM FOR OP, ABH, TEXT, GSM #
  84.  
  85. J = NEXT + OPABHSIZ; # BEGINNING ADDR FOR TEXT IN WL#
  86. WR = TLW; # WORDS TO BE TRANSFERRED TO WL#
  87. P<TAA> = LOC$TA; # TEXT AREA ADDRESS #
  88.  
  89. FOR K=1 STEP 1 UNTIL NAA DO
  90. BEGIN # COPY TEXT TO WL FROM FRA BUF #
  91. P<MEM> = TAADDR[K]; # ADDR OF KTH FRAGMENT #
  92. ACT = TAASIZE[K]; # SIZE OF KTH SEGMENT #
  93. L = ACT - 1;
  94. IF L GR WR
  95. THEN
  96. L = WR - 1;
  97. WR = WR - ACT; # WORDS REMAINING IN TEXT #
  98. FOR I = 0 STEP 1 UNTIL L DO
  99. NWL[I+J] = MEMWORD[I]; # COPY TEXT TO NWL #
  100. J = J + ACT;
  101. END
  102.  
  103. BS = TLW + OPABHSIZ; # RESET NWL ENTRY SIZE #
  104. #
  105.   WORKLIST IS SENT TO NIP IF THERE IS NO ROOM FOR ANOTHER PUT ENTRY
  106.   PLUS A GSM ENTRY OR IF IT IS A PUT FROM A SUPERVISOR.
  107. #
  108. ISSUE = (SPACE$LEFT - BS) LS (NXTSIZE + GMMESIZE);
  109.  
  110. END
  111.  
  112. ELSE
  113.  
  114. BEGIN # NO SPACE FOR TEXT #
  115.  
  116. NWL$TA[NEXT] = LOC$TA; # IF NWL CANNOT HOLD TAA #
  117. NWL$OP[NEXT] = OP$PUTF; # SET OPCODE TO PUTF #
  118. NWL$LTAA[NEXT] = NAA; # SET NO OF FRAGMENTS #
  119.  
  120. IF ACLN LQ (SPACE$LEFT - NTRYSIZ3 - GMMESIZE - OPABHSIZ) AND
  121. NAA LQ MAXNA
  122. THEN
  123.  
  124. BEGIN # IF TAA CAN FIT INTO NWL #
  125. NWL$TA[NEXT] = 0; # CLEAR TAA ADDRESS IN NWL #
  126. BS = ACLN + NTRYSIZ3; # RESET NWL ENTRY SIZE #
  127. I = NEXT + NTRYSIZ3 - 1;
  128. P<TAA> = LOC$TA; # TAA ADDRESS #
  129. FOR J=1 STEP 1 UNTIL ACLN DO
  130. NWL[I+J] = TAAWORD[J]; # COPY TAA TO NWL #
  131. END
  132.  
  133. END
  134.  
  135. RETURN;
  136. END # NP$PUTF #
  137. TERM
cdc/nos2.source/nam5871/np_putf.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator