cdc:nos2.source:nam5871:ns_gnw
Table of Contents
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
- *DECK NS$GNW
- USETEXT CYB$NS
- USETEXT DEF$NS
- USETEXT SMB$NS
- PROC NS$GNW(FROMARRAY,(BUFHDRSIZE),(NPWINDEX),NPUWORD); # GET NPU WORD #
- # TITLE NS$GNW - GET NPU WORD. #
- BEGIN # NS$GNW #
- #
- ** NS$GNW - GET NPU WORD.
- *
- * J.C. LEE 1981
- *
- * THIS ROUTINE GETS A 16-BIT NPU WORD.
- *
- * PROC NS$GNW(FROMARRAY,(BUFHDRSIZE),(NPUINDEX),NPUWORD)
- *
- * ENTRY:
- * FROMARRAY - ARRAY NPU WORD TO GET FROM.
- * BUFHDRSIZE - BUFFER HEADER SIZE IN 8-BIT BYTES.
- * NPUINDEX - NPU WORD INDEX AFTER BUFFER HEADER.
- *
- * EXIT:
- * NPUWORD = 16-BIT NPU WORD.
- *
- * METHOD:
- * THE 16-BIT NPU WORD IS EXTRACTED FROM THE "FROMARRAY".
- *
- #
- ARRAY FROMARRAY [0:0] S(1);
- BEGIN
- ITEM ARRAYWORD U(0,0,60);
- END
- ITEM BUFHDRSIZE U; # BUFFER HEADER SIZE IN 8-BIT BYTES #
- ITEM NPWINDEX U; # NPU WORD INDEX AFTER BUFFER HEADER #
- ITEM NPUWORD U; # 16-BIT NPU WORD #
- $BEGIN
- XREF
- BEGIN
- PROC NS$DBG; # TRACE PROCEDURE CALLS #
- END
- $END
- ITEM BITCOUNT I; # BIT COUNT #
- ITEM I I; # TEMPORARY #
- ITEM J I; # TEMPORARY #
- ITEM K I; # TEMPORARY #
- CONTROL EJECT;
- $BEGIN
- NS$DBG("GNW");
- $END
- P<SMB> = LOC(FROMARRAY); # FWA OF BUFFER #
- NPUWORD = 0;
- BITCOUNT = BUFHDRSIZE*ASCSIZE + NPWINDEX*NPWSIZE;
- I = BITCOUNT / WL; # WORD INDEX #
- J = BITCOUNT - I*WL; # FIRST BIT POSITION OF NPU WORD#
- K = J + NPWSIZE - WL; # BITS IN NEXT CM WORD #
- IF K GR 0
- THEN # NPU WORD CROSSES CM WORD #
- BEGIN
- B<WL-NPWSIZE,NPWSIZE-K>NPUWORD = B<J,WL-J>SMBWORD[I];
- B<WL-K,K>NPUWORD = B<0,K>SMBWORD[I+1];
- END
- ELSE # WHOLE NPU WORD FITS IN CM WORD#
- NPUWORD = B<J,NPWSIZE>SMBWORD[I];
- RETURN;
- END # NS$GNW #
- TERM
cdc/nos2.source/nam5871/ns_gnw.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator