User Tools

Site Tools


cdc:nos2.source:nam5871:ssfcbs

SSFCBS

Table Of Contents

  • [00002] PROC SSFCBS( FET, AVAIL, DATA )
  • [00003] SSFCBS - CHECK BUFFER SPACE.
  • [00007] CHECK BUFFER SPACE.

Source Code

SSFCBS.txt
  1. *DECK SSFCBS
  2. PROC SSFCBS( FET, AVAIL, DATA );
  3. # TITLE SSFCBS - CHECK BUFFER SPACE. #
  4.  
  5. BEGIN # SSFCBS #
  6. #
  7. ** SSFCBS - CHECK BUFFER SPACE.
  8. *
  9. * S. H. FISCHER. 81/10/08.
  10. *
  11. * THIS PROCEDURE COMPUTES THE NUMBER OF 60 BIT WORDS AVAILABLE
  12. * IN THE SPECIFIED CIO BUFFER AND THE NUMBER OF DATA WORDS PRESENT.
  13. *
  14. * PROC SSFCBS( FET, AVAIL, DATA)
  15. *
  16. * ENTRY:
  17. * FET = FILE ENVIRONMENT TABLE.
  18. *
  19. * EXIT:
  20. * AVAIL = NUMBER OF 60 BIT WORDS FREE IN BUFFER.
  21. * DATA = NUMBER OF 60 BIT WORDS VALID IN BUFFER.
  22. *
  23. * NOTES:
  24. * THIS PROCEEDURE IS USEFUL WHEN *READW* AND *WRITEW* ARE BEING US
  25. * AND THE CALLER MUST HAVE AN IMMEDIATE RETURN WITH NO DELAY
  26. * (CIO CALL) FROM THESE ROUTINES.
  27. *
  28. * METHOD:
  29. * THE SPACE BETWEEN IN AND OUT IS THE VALID DATA, SUBTRACTING
  30. * THIS FROM THE TOTAL BUFFER SIZE GIVES FREE SPACE.
  31. *
  32. #
  33.  
  34.  
  35.  
  36.  
  37. ARRAY FET [00:00] S(5);
  38. BEGIN
  39. ITEM FET$FIRST U(01,42,18); # ADDRESS OF FIRST WORD OF BUF #
  40. ITEM FET$IN U(02,00,60); # IN POINTER #
  41. ITEM FET$OUT U(03,00,60); # OUT POINTER #
  42. ITEM FET$LIMIT U(04,42,18); # LINIT POINTER #
  43. END
  44.  
  45. ITEM D I;
  46. ITEM S I;
  47. ITEM DATA I;
  48. ITEM AVAIL I;
  49.  
  50.  
  51.  
  52.  
  53. D = FET$IN[0] - FET$OUT[0];
  54. S = FET$LIMIT[0] - FET$FIRST[0];
  55.  
  56. IF D GQ 0
  57. THEN
  58. BEGIN
  59. DATA = D;
  60. AVAIL = S - D - 1;
  61. RETURN;
  62. END
  63. ELSE
  64. BEGIN
  65. AVAIL = -D - 1;
  66. DATA = S - AVAIL - 1;
  67. RETURN;
  68. END
  69.  
  70.  
  71.  
  72.  
  73. END # SSFCBS #
  74. TERM
cdc/nos2.source/nam5871/ssfcbs.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator