*DECK NS$PAG USETEXT COM$NS USETEXT ERR$NS USETEXT KDS$NS USETEXT SMB$NS PROC NS$PAG(ERRCODE); # PROCESS HOP/PAGE # # TITLE NS$PAG - PROCESS HOP/PAGE COMMAND. # BEGIN # NS$PAG # # ** NS$PAG - PROCESS HOP/PAGE COMMAND. * * J.C. LEE 1981 * * THIS ROUTINE PROCESS HOP/PAGE COMMAND. * * PROC NS$PAG(ERRCODE) * * ENTRY: * NONE. * * EXIT: * ERRCODE. * * METHOD: * IF K-DISPLAY ASSIGNED: * IF HOP CHARACTER = "-": * SET PAGE-WAIT TO FALSE. * IF HOP CHARACTER = "+": * SET PAGE-WAIT TO TRUE. * ELSE, FLAG ERROR. * IF ERRCODE = 0: * ACCESS PAGE-WAIT BUFFER. * IF PAGE-WAIT BUFFER LINE COUNT NQ 0: * SEND LINES TO K-DISPLAY BUFFER. * UPDATE PAGE-WAIT BUFFER WORD-COUNT. * CALL TSB MANAGER TO REDUCE PAGE-WAIT BUFFER * SIZE BY NUMBER OF WORDS SENT TO K-DISPLAY. * ELSE, FLAG ERROR. * # ITEM ERRCODE U; # ERROR CODE # $BEGIN XREF BEGIN PROC NS$DBG; # TRACE PROC CALL # END $END XREF BEGIN PROC EXREDUC; # REDUCE TSB SIZE # PROC MOVEOK; # ALLOW MOVE # FUNC NS$FEC U; # FORMAT ERROR CODE # PROC NS$TKD; # MANAGE K-DISPLAY # PROC TSBINFO; # TSB INFORMATION # END DEF CHAR$MINUS # "-" #;# MINUS IN DISPLAY CODE # DEF CHAR$PLUS # "+" #;# PLUS IN DISPLAY CODE # ITEM PWBLC U; # PAGE WAIT BUFFER LINE COUNT # ITEM PWBTSBN U; # PAGE WAIT BUFFER TSB NUMBER # ITEM PWBWC U; # PAGE WAIT BUFFER WORD COUNT # ITEM TSBFWA U; # TSB FWA # ITEM TSBSIZE U; # TSB SIZE # BASED ARRAY PWB[0:0]P(1); BEGIN # PAGE WAIT BUFFER # ITEM PWBLINES U(00,00,60); END CONTROL EJECT; $BEGIN NS$DBG("PAG"); # TRACE CALL # $END IF DCW$F$ASS[0] THEN # K-DISPLAY IS ASSIGNED # BEGIN IF HOPPC[0] EQ CHAR$MINUS THEN # HOP PAGE CHARACTER IS "-" # DCW$F$PWM[0] = FALSE; # TURN PAGE WAIT TO OFF # ELSE BEGIN IF HOPPC[0] EQ CHAR$PLUS THEN # HOP PAGE CHARACTER IS "+" # DCW$F$PWM[0] = TRUE; # TURN PAGE WAIT TO ON # ELSE # NAM ERROR, ILLEGAL PAGE CHARACTER # ERRCODE = NS$FEC(EC"ERR$SM", SMEC"HSM$HOPSM"); END IF ERRCODE EQ 0 THEN BEGIN # TURN PAGE VIA PAGE WAIT BUFFER # DCW$F$PAGE[0] = FALSE; # CLEAR PAGE FULL FLAG # DCW$LC[0] = 0; # SET NAM K DISPLAY LINE COUNT TO ZERO # PWBTSBN = DCW$PWBTSB[0]; # PAGE WAIT BUFFER TSB NUMBER # TSBINFO(TSBSIZE,TSBFWA,PWBTSBN); # LOACATE PAGE WAIT BUFFER # P = 0; PWBLC = PWB$LC[TSBFWA]; # PAGE WAIT BUFFER LINE COUNT # PWBWC = PWB$WC[TSBFWA] - PWB$HDRL; # PWB WORD COUNT # IF PWBLC NQ 0 THEN # LINES EXIST IN PAGE WAIT BUFFER # BEGIN # MOVE LINES TO K DISPLAY BUFFER KDB # P = TSBFWA + PWB$HDRL; # FWA OF FIRST LINE IN PWB # NS$TKD(PWB,PWBWC,PWBLC); EXREDUC(PWBWC,PWBTSBN,FALSE,TSBFWA); PWB$LC[TSBFWA] = 0; # PWB NOW HAS A HEADER ONLY # PWB$WC[TSBFWA] = PWB$HDRL; END MOVEOK(PWBTSBN); # ALLOW PAGE WAIT BUFFER TO MOVE # END END ELSE BEGIN # K-DISPLAY NOT ASSIGNED - SET ERROR CODE # ERRCODE = NS$FEC(EC"ERR$SM", SMEC"HSM$HOPSM"); END RETURN; END # HS$PAG PROC # TERM