*DECK BWLBLK
USETEXT NIPDEF
USETEXT ACB
USETEXT APPSTAT
USETEXT STATTAB
PROC BWLBLK(SOURCE,SINK,BLKSIZE);
STARTIMS;
#
*1DC BWLBLK
*
* 1. PROC NAME AUTHOR DATE
* BWLBLK E. GEE 77/09/14
*
* 2. FUNCTIONAL DESCRIPTION.
* WRITE TEXT FROM NIP-S FIELD LENGTH TO APP-S FIELD LENGTH
*
* 3. METHOD USED.
* IF TEXT IS GREATER THAN 64 WORDS,
* SET UP EXTENDED WRITE SCP FUNCTION REQUEST.
* ELSE (NORMAL SCP WRITE FUNCTION IS SUFFICIENT),
* SET UP WRITE SCP FUNCTION REQUEST.
* CALL HWRTDA TO ISSUE SCP FUNCTION REQUEST AND PROCESS
* RETURN CODE.
*
* 4. ENTRY PARAMETERS.
* BLKSIZE SIZE OF BLK TO WRITE TO APP FL
* NEXTWLA ADDR OF NEXT NETWORK WORKLIST ENTRY
* ACBADDR ACB ADDRESS
* SINK APP ADDRESS TO WRITE TEXT TO
* SOURCE ADDR OF BLK TO WRITE TO APP FL
*
* 5. EXIT PARAMETERS.
* ABTAPPF ABORT FLG SET IF NIP GOT SCP RC = RCUCPAOOR
* DONE SET FALSE IF TEXT NOT WRITTEN TO APP FL
* FAILADR FAIL FLG SET IF NOT GOT SCP RC = RCUCPGONE
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED.
* ACB APPSTAT
* NIPDEF
* STATTAB STATISTICS TABLE
*
* 7. ROUTINES AND OVERLAYS CALLED.
* HWRTDA WRITE DATA TO APP FIELD LENGTH
* OTIME GET SYSTEM TIME
* XTRACE RECORD PROCEDURE CALLS
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
* NONE
*
#
STOPIMS;
# INPUT PARAMETERS #
ITEM SOURCE; # FWA OF BUFFER IN NIP-FL #
ITEM SINK; # UCP ADDRESS IN APP-FL #
ITEM BLKSIZE; # BLOCK SIZE IN CM WORDS #
# OUTPUT PARAMETERS NONE #
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC HWRTDA; # WRITE DATA TO APP FIELD LENGTH#
PROC OTIME; # GET SYSTEM TIME #
PROC XTRACE; # TRACE CALL #
END
#
LOCAL VARIABLES
#
ARRAY FLW P(3); # ARRAY FOR ISSUING SCP CALL #
BEGIN
ITEM FLWRC U(00,00,06); # RETURN CODE FROM SCP CALL #
ITEM FLWFP U(00,06,12); # NUMBER OF WORDS TO WRITE #
ITEM FLWUCPA U(00,18,18); # UCP ADR FOR SF.WRITE SCP FUNC #
ITEM FLWSCPA U(00,36,18); # SCP ADR FOR SF.WRITE SCP FUNC #
ITEM FLWFC U(00,54,06); # SCP FUNCTION CODE #
ITEM FLWCB U(00,59,01); # SCP FUNCTION COMPLETION BIT #
ITEM FLWWD0 U(00,00,60) = [0]; # WORD 0 OF SCP FUNCTION BUFFER #
ITEM FLWJSNWD U(01,00,60); # UCP JSN / EJT ORDINAL WORD #
ITEM FLWXUCPA U(02,12,24); # UCP ADR FOR SF.XWRITE SCP FUNC#
ITEM FLWXSCPA U(02,36,24); # SCP ADR FOR SF.XWRITE SCP FUNC#
ITEM FLWWD2 U(02,00,60) = [0]; # WORD 2 OF SCP FUNCTION BUFFER #
END
ITEM BUFSIZ; # BUFFER SZE IN CM WORDS #
CONTROL IFEQ STAT,1;
ARRAY STIME P(1); # RTIME BUFFER FOR STARTING TIME#
BEGIN
ITEM SMILS U(0,24,36); # STARTING TIME IN MILLESECONDS #
END
ARRAY ETIME P(1); # RTIME BUFFER FOR ENDING TIME #
BEGIN
ITEM EMILS U(0,24,36); # ENDING TIME IN MILLESECONDS #
END
ITEM STTEMP; # TEMPORARY STATISTICS VARIABLE #
CONTROL FI;
#**********************************************************************#
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("BWLBL") ;
CONTROL FI;
CONTROL IFEQ STAT,1;
OTIME(STIME); # GET SYSTEM TIME AT BEGINNING #
CONTROL FI;
DONE = FALSE;
P<ACB> = ACBADDR;
FLWWD0[0] = 0; # INITIALIZE SCP FUNCTION WD #
FLWFP[0] = BLKSIZE; # WORD COUNT TO BE TRANSFERRED #
FLWJSNWD[0] = ACBJNWD[0];
IF BLKSIZE GR 64
THEN # EXTENDED WRITE SCP FUNC NEEDED#
BEGIN
FLWXUCPA[0] = SINK; # UCP ADDR TO WRITE TEXT TO #
FLWXSCPA[0] = SOURCE + BLKHSIZE + ABHSIZE;
FLWFC[0] = SFXWRT; # SF.XWRITE SCP FUNCTION CODE #
BUFSIZ = FLXSIZE; # SIZE OF SCP FUNCTION BLOCK #
END
ELSE # NORMAL SCP WRITE FUNCTION USED#
BEGIN
FLWUCPA[0] = SINK; # UCP ADDR TO WRITE TEXT TO #
FLWSCPA[0] = SOURCE + BLKHSIZE + ABHSIZE;
FLWFC[0] = SFWRITE; # SF.WRITE SCP FUNCTION CODE #
BUFSIZ = FLSIZE; # SIZE OF SCP FUNCTION BLOCK #
END
HWRTDA(FLW,BUFSIZ,SOURCE);
CONTROL IFEQ STAT,1;
OTIME(ETIME); # GET SYSTEM TIME AT END OF PROC#
ST$NWR = ST$NWR + 1; # INCR NO OF TIMES BWLBLK CALLED#
STTEMP = EMILS[0] - SMILS[0]; # TIME SPENT IN ROUTINE #
ST$TWR = ST$TWR + STTEMP; # TOTAL TIME SPENT IN ROUTINE #
IF ST$LWR LS STTEMP
THEN # FOUND LARGER TIME INTERVAL #
BEGIN
ST$LWR = STTEMP; # NEW LARGEST TIME INTERVAL #
END
CONTROL FI;
RETURN;
END
TERM