User Tools

Site Tools


cdc:nos2.source:nam5871:ns_gnw

NS$GNW

Table Of Contents

  • [00006] PROC NS$GNW(FROMARRAY,(BUFHDRSIZE),(NPWINDEX),NPUWORD)
  • [00008] NS$GNW - GET NPU WORD.
  • [00012] GET NPU WORD.
  • [00045] PROC NS$DBG

Source Code

NS$GNW.txt
  1. *DECK NS$GNW
  2. USETEXT CYB$NS
  3. USETEXT DEF$NS
  4. USETEXT SMB$NS
  5.  
  6. PROC NS$GNW(FROMARRAY,(BUFHDRSIZE),(NPWINDEX),NPUWORD); # GET NPU WORD #
  7.  
  8. # TITLE NS$GNW - GET NPU WORD. #
  9.  
  10. BEGIN # NS$GNW #
  11. #
  12. ** NS$GNW - GET NPU WORD.
  13. *
  14. * J.C. LEE 1981
  15. *
  16. * THIS ROUTINE GETS A 16-BIT NPU WORD.
  17. *
  18. * PROC NS$GNW(FROMARRAY,(BUFHDRSIZE),(NPUINDEX),NPUWORD)
  19. *
  20. * ENTRY:
  21. * FROMARRAY - ARRAY NPU WORD TO GET FROM.
  22. * BUFHDRSIZE - BUFFER HEADER SIZE IN 8-BIT BYTES.
  23. * NPUINDEX - NPU WORD INDEX AFTER BUFFER HEADER.
  24. *
  25. * EXIT:
  26. * NPUWORD = 16-BIT NPU WORD.
  27. *
  28. * METHOD:
  29. * THE 16-BIT NPU WORD IS EXTRACTED FROM THE "FROMARRAY".
  30. *
  31. #
  32.  
  33. ARRAY FROMARRAY [0:0] S(1);
  34. BEGIN
  35. ITEM ARRAYWORD U(0,0,60);
  36. END
  37.  
  38. ITEM BUFHDRSIZE U; # BUFFER HEADER SIZE IN 8-BIT BYTES #
  39. ITEM NPWINDEX U; # NPU WORD INDEX AFTER BUFFER HEADER #
  40. ITEM NPUWORD U; # 16-BIT NPU WORD #
  41.  
  42. $BEGIN
  43. XREF
  44. BEGIN
  45. PROC NS$DBG; # TRACE PROCEDURE CALLS #
  46. END
  47. $END
  48.  
  49. ITEM BITCOUNT I; # BIT COUNT #
  50. ITEM I I; # TEMPORARY #
  51. ITEM J I; # TEMPORARY #
  52. ITEM K I; # TEMPORARY #
  53. CONTROL EJECT;
  54.  
  55. $BEGIN
  56. NS$DBG("GNW");
  57. $END
  58.  
  59. P<SMB> = LOC(FROMARRAY); # FWA OF BUFFER #
  60. NPUWORD = 0;
  61. BITCOUNT = BUFHDRSIZE*ASCSIZE + NPWINDEX*NPWSIZE;
  62. I = BITCOUNT / WL; # WORD INDEX #
  63. J = BITCOUNT - I*WL; # FIRST BIT POSITION OF NPU WORD#
  64. K = J + NPWSIZE - WL; # BITS IN NEXT CM WORD #
  65.  
  66. IF K GR 0
  67. THEN # NPU WORD CROSSES CM WORD #
  68. BEGIN
  69. B<WL-NPWSIZE,NPWSIZE-K>NPUWORD = B<J,WL-J>SMBWORD[I];
  70. B<WL-K,K>NPUWORD = B<0,K>SMBWORD[I+1];
  71. END
  72.  
  73. ELSE # WHOLE NPU WORD FITS IN CM WORD#
  74. NPUWORD = B<J,NPWSIZE>SMBWORD[I];
  75.  
  76. RETURN;
  77. END # NS$GNW #
  78. TERM
cdc/nos2.source/nam5871/ns_gnw.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator