*DECK BRLBLK
USETEXT NIPDEF
USETEXT APPSTAT
USETEXT NWLNTRY
USETEXT AT
USETEXT ACB
USETEXT STATTAB
PROC BRLBLK((BUFADR1),TXTLN);
STARTIMS;
#
*1DC BRLBLK
*
* 1. PROC NAME AUTHOR DATE
* BRLBLK E. GEE 77/09/14
*
* 2. FUNCTIONAL DESCRIPTION.
* READ TEXT FROM APP FL TO NIP FL
*
* 3. METHOD USED.
* IF TEXT IS GREATER THAN 64 WORDS LONG,
* SET UP EXTENDED READ FUNCTION TO READ TEXT INTO NIP FL.
* ELSE (TEXT IS LESS THAN OR EQUAL TO 64 WORDS LONG),
* SET UP NORMAL SYSTEM CONTROL POINT READ FUNCTION.
* ISSUE SCP CALL.
* IF SYSTEM CONTROL POINT CALL RETURN CODE IS NONZERO,
* IF RETURN CODE IS UCP IS SWAPPED OUT,
* ISSUE SCP SWAPIN OF APPLICATION.
* ELSE (RETURN CODE OTHER THAN SCP SWAPPED OUT),
* SET ABORT APPLICATION OR APPLICATION FAILED FLAGS.
* ELSE (NO ERROR RETURN CODE FROM OPERATING SYSTEM),
* IF NOT ALL OF THE DATA HAS BEEN READ INTO NIP FL,
* CLEAR COMPLETION BIT AND GO BACK AND REISSUE SCP CALL.
*
* 4. ENTRY PARAMETERS.
* BUFADR1 ADDR OF BUF TO HOLD TEXT
* ACBADDR ACB ADDRESS
* TXTLN LENGTH OF TEXT TO READ
* WLADDR NETWORK WORKLIST ENTRY ADDRESS
*
* 5. EXIT PARAMETERS.
* ABTAPPF ABORT FLG SET IF NIP GOT SCP RC = RCUCPAOOR
* DONE SET FALSE IF TEXT NOT READ IN
* FAILADR FAIL FLG SET IF NIP GOT SCP RC = RCUCPGONE
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED.
* ACB AT APPSTAT
* NIPDEF NWLNTRY
* STATTAB STATISTICS TABLE
*
* 7. ROUTINES AND OVERLAYS CALLED.
* OSCCALL ISSUE SCP CALL
* OSCHAPP SCHEDULE APPLICATION
* OTIME GET SYSTEM TIME
* XTRACE RECORD PROCEDURE CALLS
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION.
* NONE
*
#
STOPIMS;
#
INPUT PARAMETERS
#
ITEM BUFADR1; # FWA TO STORE ABH AND TEXT #
ITEM TXTLN I; # NO OF WORDS TO READ FROM UCP #
#
OUTPUT PARAMETERS
NONE
#
#
EXTERNAL VARIABLES
#
XREF
BEGIN
PROC OSCCALL; # SYSTEM CONTROL POINT CALL #
PROC OSCHAPP; # SCHEDULE AN APPLICATION #
PROC OTIME; # GET SYSTEM TIME #
PROC XTRACE; # TRACE CALL #
END
#
LOCAL VARIABLES
#
ARRAY FLR P(3); # ARRAY FOR ISSUING SCP CALL #
BEGIN
ITEM FLRRC U(00,00,06); # RETURN CODE FROM SCP CALL #
ITEM FLRFP U(00,06,12); # NUMBER OF WORDS TO READ #
ITEM FLRUCPA U(00,18,18); # UCP ADR FOR SF.READ SCP FUNC #
ITEM FLRSCPA U(00,36,18); # SCP ADR FOR SF.READ SCP FUNC #
ITEM FLRFC U(00,54,06); # SCP FUNCTION CODE #
ITEM FLRCB U(00,59,01); # SCP FUNCTION COMPLETION BIT #
ITEM FLRWD0 U(00,00,60) = [0]; # WORD 0 OF SCP FUNCTION BUFFER #
ITEM FLRJSNWD U(01,00,60); # UCP JSN / EJT ORDINAL WORD #
ITEM FLRXUCPA U(02,12,24); # UCP ADR FOR SF.XREAD SCP FUNC #
ITEM FLRXSCPA U(02,36,24); # SCP ADR FOR SF.XREAD SCP FUNC #
ITEM FLRWD2 U(02,00,60) = [0]; # WORD 2 OF SCP FUNCTION BUFFER #
END
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("BRLBL") ;
CONTROL FI;
CONTROL IFEQ STAT,1;
OTIME(STIME); # GET SYSTEM TIME AT BEGINNING #
CONTROL FI;
DONE = FALSE; # SET FUNCTION INCOMPLETE #
P<ACB> = ACBADDR;
P<NWLENTRY> = WLADDR;
FLRWD0[0] = 0; # INITIALIZE RETURN CODE FIELD #
FLRFP[0] = TXTLN; # WORD COUNT TO BE TRANSFERRED #
FLRJSNWD[0] = ACBJNWD[0];
IF TXTLN GR 64
THEN # EXTENDED READ SCP FUNC NEEDED #
BEGIN
FLRFC[0] = SFXRED; # SF.XREAD FUNCTION CODE #
FLRXUCPA[0] = NWLTA[0]; # UCP ADDR TO READ FROM #
FLRXSCPA[0] = BUFADR1 + ABHSIZE; # SCP ADDR TO READ TO #
END
ELSE # READ SCP FUNCTION SUFFICIENT #
BEGIN
FLRFC[0] = SFREAD; # SF.READ FUNCTION CODE #
FLRUCPA[0] = NWLTA[0]; # UCP ADDR TO READ FROM #
FLRSCPA[0] = BUFADR1 + ABHSIZE; # SCP ADDR TO READ TO #
END
RDBLK:
OSCCALL(FLR); # ISSUE SCP REQUEST #
IF FLRRC[0] NQ 0
THEN
BEGIN
IF FLRRC[0] EQ RCSWAPPEDOUT
THEN
BEGIN # USER JOB SWAPPED OUT #
ATASBS[ACBAN[0]] = TRUE; # SET APP SWAPPED OUT BIT IN AT #
OSCHAPP(ACBADDR); # SCHEDULE APPLICATION #
END
ELSE
BEGIN
IF FLRRC[0] EQ RCUCPAOOR
THEN
ABTAPPF = XFLERR; # UCPA IS OUT OF RANGE #
ELSE
FAILADR = ACBADDR; # OTHER SCP ERROR RETURN CODE #
END
END
ELSE
BEGIN # SCP REQUEST HAS COMPLETED #
IF FLRFP[0] NQ 0 AND # IF DATA TRANSFER NOT COMPLETE #
TXTLN GR 64 # EXTENDED READ FUNCTION ISSUED #
THEN
BEGIN
FLRCB[0] = 0; # CLEAR COMPLETE BIT #
GOTO RDBLK; # REISSUE SF.READ REQUEST #
END
DONE = TRUE; # SET FUNCTION COMPLETE FLAG #
END
CONTROL IFEQ STAT,1;
OTIME(ETIME); # GET SYSTEM TIME AT END OF PROC#
ST$NBR = ST$NBR + 1; # INCR NO OF TIMES PROC CALLED #
STTEMP = EMILS[0] - SMILS[0]; # TIME SPENT IN THIS ROUTINE #
ST$TBR = ST$TBR + STTEMP; # TOTAL TIME SPENT IN ROUTINE #
IF ST$LBR LS STTEMP
THEN # FOUND LARGER TIME INTERVAL #
BEGIN
ST$LBR = STTEMP; # NEW LARGEST TIME INTERVAL #
END
CONTROL FI;
RETURN;
END
TERM