User Tools

Site Tools


cdc:nos2.source:nam5871:xsappdl

XSAPPDL

Table Of Contents

  • [00005] PRGM XSAPPDL
  • [00052] PROC XTRACE

Source Code

XSAPPDL.txt
  1. *DECK XSAPPDL
  2. USETEXT NIPDEF
  3. USETEXT PARAMS
  4. USETEXT SWAPIN
  5. PRGM XSAPPDL; # DELINK (NO ACB) SWAPIN ENTRY #
  6.  
  7. STARTIMS;
  8. #
  9. *1DC XSAPPDL
  10. *
  11. * 1. PROC NAME AUTHOR DATE
  12. * XSAPPDL E. GEE 77/08/10
  13. *
  14. * 2. FUNCTIONAL DESCRIPTION.
  15. * DELINK ENTRY FROM (NO ACB) SWAPIN CHAIN
  16. *
  17. * 3. METHOD USED.
  18. * IF ONLY ONE ENTRY IN SWAPIN CHAIN, CLEAR PTRS IN SWAPIN
  19. * ELSE UPDATE BACKWARD POINTER IN NEXT ENTRY AND
  20. * UPDATE FORWARD POINTER IN PREVIOUS ENTRY
  21. *
  22. * 4. ENTRY PARAMETERS.
  23. * PARAMS1 ADDRESS OF ENTRY TO DELINK
  24. *
  25. * 5. EXIT PARAMETERS.
  26. * NONE
  27. *
  28. * 6. COMDECKS CALLED AND SYMPL TEXTS USED.
  29. * NIPDEF OSSIZE PARAMS SWAPIN
  30. *
  31. * 7. ROUTINES AND OVERLAYS CALLED.
  32. * XTRACE RECORD PROCEDURE CALLS
  33. *
  34. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
  35. *
  36. * THIS PROGRAM IS A SECONDARY OVERLAY LOADED BY SUBROUTINE
  37. * OVLCALL. WHEN EXECUTION HAS COMPLETED, A JUMP IS MADE TO
  38. * LOCATION RJMAIN TO RETURN TO THE CALLING PROGRAM.
  39. *
  40. * W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
  41. *CALL OSSIZE
  42. *
  43. * THIS OVERLAY IS CALLED BY XSAPPRC AND HAPFAIL.
  44. *
  45.  #
  46. STOPIMS;
  47. #
  48.   EXTERNAL VARIABLES
  49. #
  50. XREF
  51. BEGIN
  52. PROC XTRACE; # RECORD PROCEDURE CALLS #
  53. LABEL RJMAIN; # RETURN ADDRESS IN OVLCALL #
  54. END
  55. #
  56.   INTERNAL VARIABLES
  57. #
  58. ITEM NEXT; # ADDR OF NEXT ENTRY IN SWAPIN CHAIN #
  59. ITEM PREV; # ADDR OF PREVIOUS ENTRY IN SWAPIN CHAIN #
  60. ITEM SENTRY; # ADDR OF SWAPIN ENTRY TO DELETE #
  61.  
  62. #**********************************************************************#
  63.  
  64. BEGIN
  65.  
  66. CONTROL IFEQ DEBUG,1;
  67. XTRACE("APPDL") ;
  68. CONTROL FI;
  69.  
  70. SENTRY = PARAMS1; # ADDR OF SWAPIN ENTRY TO DELETE #
  71. P<SWPIE> = SENTRY;
  72. NEXT = SWPINFP[0]; # ADDR OF NEXT ENTRY IN SWAPIN CHAIN #
  73. PREV = SWPINBP[0]; # ADDR OF PREVIOUS ENTRY IN SWAPIN CHAIN #
  74. #
  75.   CHECK IF ONLY ONE ENTRY IN SWAPIN CHAIN
  76. #
  77. IF SWAPINFP EQ SWAPINBP
  78. THEN # ONLY ONE ENTRY IN CHAIN #
  79. BEGIN
  80. SWAPINFP = 0; # ZERO SWAPIN CHAIN FORWARD PTR #
  81. SWAPINBP = 0; # ZERO SWAPIN CHAIN BACKWARD PTR #
  82. END
  83. ELSE # MORE THAN ONE ENTRY IN CHAIN SO DELINK #
  84. #
  85.   UPDATE BACKWARD PTR IN NEXT ENTRY
  86. #
  87. BEGIN
  88. IF NEXT EQ LOC(SWAPINFP)
  89. THEN # ENTRY TO DELETE IS LAST ONE IN CHAIN #
  90. SWAPINBP = PREV; # UPDATE SWAPIN BACKWARD PTR #
  91. ELSE
  92. BEGIN
  93. P<SWPIE> = NEXT;
  94. SWPINBP[0] = PREV; # UPDATE BACKWARD PTR OF NEXT ENTRY #
  95. END
  96. #
  97.   UPDATE FORWARD POINTER IN PREVIOUS ENTRY
  98. #
  99. IF PREV EQ LOC(SWAPINBP)
  100. THEN # ENTRY TO DELETE IS FIRST ONE IN CHAIN #
  101. SWAPINFP = NEXT; # UPDATE SWAPIN FORWARD PTR #
  102. ELSE
  103. BEGIN
  104. P<SWPIE> = PREV;
  105. SWPINFP[0] = NEXT; # UPDATE FORWARD PTR OF PREVIOUS ENTRY #
  106. END
  107. END
  108. GOTO RJMAIN; # RETURN TO CALLING PROGRAM #
  109. END
  110. TERM
cdc/nos2.source/nam5871/xsappdl.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator