.Title TCR .Ident /V7.12/ .Enable Lc ; ; Tcr - The Terminal Characteristics Program ; ; Author: ; Michael Lynch ; Engineering Systems and Technology Labs ; 3M Company ; 3M Center ; St. Paul, Minnesota ; ; Revision History: ; ; 12-Jul-80 Release 7 Include M/Plus support ; ; 26-Sep-80 Ml7.01 -- Clean up TPars error processing ; ; 18-Oct-84 V7.11 Add additional terminal types, Name length ; to 14 characters. BLT ; ; 20-Nov-84 V7.12 Name length down to 6 characters. BLT ;- .Page .IF Df, R$$Mpl ;M/Plus T$$Cpw=0 ;M+ has full duplex TT driver T$$Vbf=0 ;Buffer size supported T$$Syn=0 ;^s/^q supported T$$Hld=0 ;hold screen supported T$$Trw=0 ;Read pass all supported T$$Hff=0 ;hardware form feeds .Endc ;end of M/Plus conditional ; ; Force supported options into the Table of Contents ; NumFea=2 ;start out with 2 features .Sbttl Tcr Supported features: .Sbttl ---------------------- .Sbttl .If df, R$$Mpl .Sbttl Rsx-11M-PLUS Accounting ; .Sbttl .EndC .If df, D$$H11!D$$Z11&T$$Cpw .Sbttl Set Speed supported ; .Sbttl .EndC .Sbttl Terminal Type Supported ; .Sbttl .If Df, T$$Vbf&T$$Cpw .Sbttl Buffer size supported ; .Sbttl .EndC .Sbttl Spooled devices supported ; .Sbttl .Sbttl Offline Terminal notification supported ; .Sbttl .If Df, T$$Syn&T$$Cpw .Sbttl Suspend=^S,^O supported ; .Sbttl .EndC .Sbttl Privilege terminal supported ; .Sbttl .Sbttl Slave supported ; .Sbttl .If Df, T$$Rne .Sbttl Read No Echo supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df, T$$Hld .Sbttl Hold Screen supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df, T$$Trw&T$$Cpw .Sbttl Read Pass All supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df, T$$Cpw .Sbttl Full Duplex supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df, D$$M11!D$$ZMD&T$$CPW .Sbttl Remote dial-up supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df, T$$Esc .Sbttl Escape sequences supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df, T$$HFF .Sbttl Hardware Form Feeds supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df, T$$Rub .Sbttl Crt supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .Endc .If Df, T$$Lwc .Sbttl LowerCase supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .If Df,T$$Cpw .Sbttl 8-Bit Ascii input mode supported ; .Sbttl NumFea = NumFea + 1 ;bump loop features count .EndC .Page .SbTTl Macros, Constants, & other data .MCALL FDOF$L,FCSBT$S,FDBDF$,FDAT$A,FDRC$A,FDOP$A,FDBF$A,FSRSZ$ .MCALL CLOSE$,GLUN$S,FINIT$,Open$R,Get$r,Dir$ .Mcall Qiow$,Qiow$S,Alun$s,Rcvd$,Gmcr$,ExSt$S .MCall TTsym$,UcbDf$ .MCall Gcml$,GcmlB$,GcmlD$ TTSym$ UcbDf$ ; ; Define DEBUG conditionals here ; ;Debug1 = 0 ;print sub-get arrival message ; ; Print macro definition ; .Macro Print Add,Length .If Nb,Length Mov Add,TTyOut+Q.IoPl Mov Length,TTyOut+Q.Iopl+2 .IFF Mov R0,-(Sp) Mov add,R0 Movb (R0)+,Ttyout+Q.Iopl+2 Mov R0,TtyOut+Q.iopl Mov (Sp)+,R0 .Endc Dir$ #TTYout .Endm ; ; String macro definition ; .MACRO String STR,SEQUEN .IF B,SEQUEN $$T$$$=0 $$l$$$=. .BYTE 0 .IFF .if eq,<''SEQUEN-'B> $$T$$$=0 $$l$$$=. .BYTE 0 .endc .ENDC .IF NB, .ASCII STR .ENDC .IF B,SEQUEN $$E$$$=. .=$$L$$$ $$T$$$=$$E$$$-$$L$$$-1 .BYTE $$T$$$ .=$$E$$$ .IFF .IF EQ,<''SEQUEN-'E> $$E$$$=. .=$$L$$$ $$T$$$=$$E$$$-$$L$$$-1 .BYTE $$T$$$ .=$$E$$$ .ENDC .endc .ENDM TTYout: Qiow$ Io.Wvb,TTyLun,TTyEfn,,TTysts,, TTYsts: .BlkW 2 ; ; Logical Unit Number (Lun) Table ; FilLun = 2 ;Lun for MAILLOG.DAT file ChrLun = 3 ;Lun for characteristics tests GmlLun = 4 ;Lun for get command line TTyLun = 5 ;Lun for TI: BrkLun = 6 ;Lun used to inform user that he has mail ; ; Event Flag Table ; FilEfn = 1 ;event flag for MAILLOG.DAT file I/O ChrEfn = 3 ;event flag for characteristics tests TTyEfn = 5 ;event flag for TI: I/O BrkEfn = 6 ;event flag used to inform of mail delivery ; ; Set up Ascii codes ; Bell=7 Lf=12 Cr=15 Tab = 11 ; ; ; ; NamSiz = 3 ;set up length of last name print-out NamSiz = 6 ;set up length of last name print-out ; ; Get command line macros and buffers ; Fsrsz$ 1 ;ask for buffer GcmlD$ ;define GcmlB$ offsets CmdBuf: GcmlB$ 1,Tcr,LinBuf,4 ;Lun 4 = command line input LinBuf: .BlkW 41. ; ; GLUN$ buffer ; LunBuf: .BlkW 6 ; ; Tpars stuff ; ; ParBug=0 ;remove leading ";" to assemble tpars debugger TTTyp: .Word 0 ;terminal 2-letter code for TI: TTnum: .word 0 ;terminal specified in command line Mask: .word 0 ;command line component mask ; ; Tpars parser return mask bit definitions ; Lg.Msk = 1 ;only logged in terminals printed Al.Msk = 2 ;print all terminals TT.Msk = 4 ;just print "TTnum" info Hp.Msk = 10 ;just print help message Sa.Msk = 20 ;print a sample display Id.Msk = 40 ;print Tcr's current version TI.Msk = 100 ;just print TI: info ; ; The following 2 mask bits are set/cleared in main code, not by TPARS ; Of.Msk = 200 ;set if unit offline Sl.Msk = 400 ;set if unit is a spooler ; ; Data structure required for Sf.Gmc Qio call ; GmcChr: .IF Df, D$$H11!D$$Z11&T$$Cpw ;if either DZ or DH in system .Byte Tc.Rsp,0 ;Receive speed (terminal transmit speed) .Byte Tc.Xsp,0 ;Transmit speed (Terminal receive speed) .EndC ;of DH, DZ conditional SubChr: .Byte Tc.Ttp,0 ;terminal type .IIf Df, T$$Vbf&T$$Cpw .Byte Tc.Wid,0 ;Buffer size AltChr: .IIf Df, T$$Syn&T$$Cpw .Byte Tc.Cts,0 ;Suspend .Byte Tc.pri,0 ;Priviledged .Byte Tc.Slv,0 ;slave .IIf Df, T$$Rne .Byte Tc.Nec,0 ;No echo .IIf Df, T$$HLD .Byte Tc.Hld,0 ;Hold screen .IIf Df, T$$Trw&T$$Cpw .Byte Tc.Bin,0 ;read pass all (RPA) .IIf Df, T$$Cpw .Byte Tc.Fdx,0 ;full duplex mode .IIf Df, D$$M11!D$$ZMD&T$$Cpw .Byte Tc.Dlu,0 ;dial-up line (Remote) .IIf Df, T$$Esc .Byte Tc.Esq,0 ;escape sequence .IIF Df, T$$Hff .Byte Tc.Hff,0 ;hardware form feeds .IIf Df, T$$Rub .Byte Tc.Scp,0 ;crt .IIf Df, T$$LwC .Byte Tc.Smr,0 ;lower case .IIf Df, T$$Cpw .Byte Tc.8bc,0 ;8-bit ascii input mode GmcLth = .-GmcChr SubLth = .-SubChr .Byte 0 ;end of Gmc Table .If Df, T$$Vbf&T$$Cpw ;if variable width buffer WidBuf: .BlkB 3 ;buffer to hold ascii representation of Tc.Wid .EndC .Page .SbTtl Ascii messages ; ; Table of Key words to describe terminal status ; KeyTab: .IIf Df, D$$H11!D$$Z11&T$$Cpw String <" Speed"> ;Tc.Xsp = 4, Tc.Rsp = 3 String <" Term="> ;Tc.Ttp = 10 .IIf Df, T$$Vbf&T$$Cpw String <" Buffer="> ;Tc.Wid = 1 AltTab: String <" Spool"> ;U.Cw1, Bit 11 String <" OffLine"> ;Ie.Ofl returned on Sf.Gmc in "GETCAR" .IIf Df, T$$Syn&T$$Cpw String <" Suspend="> ;Tc.Cts = 72 String <" Priv"> ;Tc.Pri = 51 String <" Slave"> ;Tc.Slv = 50 .IIf Df, T$$Rne String <" NoEcho"> ;Tc.Nec = 47 .IIf Df, T$$Hld String <" Hold"> ;Tc.Hld = 44 .IIf Df, T$$Trw&T$$Cpw String <" Read-Pass-All"> ;Tc.Bin = 65 .IIf Df, T$$Cpw String <" Full-Duplex"> ;Tc.Fdx = 64 .IIf Df, D$$M11!D$$ZMD&T$$Cpw String <" Remote"> ;Tc.DLU = 41 .Iif Df, T$$Esc String <" Escape"> ;Tc.ESQ = 35 .IIf Df, T$$HFF String <" FormFeed"> ;Tc.HFF = 17 .IIF Df, T$$Rub String <" CRT"> ;Tc.Scp = 12 .IIf Df, T$$LwC String <" LowerCase"> ;Tc.SMR = 25 .IIf Df, T$$Cpw String <" 8-Bit"> ;Tc.8bc = 67 .If Df, D$$H11!D$$Z11&T$$Cpw ;if DZ or DH in system Speed: String <": ? "> String <": 0"> String <": 50"> String <": 75"> String <": 100"> String <": 110"> String <": 134"> String <": 150"> String <": 200"> String <": 300"> String <": 600"> String <":1200"> String <":1800"> String <":2000"> String <":2400"> String <":3600"> String <":4800"> String <":7200"> String <":9600"> String <":ExtA"> String <":ExtB"> String <":19.2"> String <":38.4"> .EndC ;of DZ, DH conditional Type: String <" ? "> String <"Asr33"> String <"Ksr33"> String <"Asr35"> String <"La30s"> String <"La30P"> String <"La36 "> String <"Vt05 "> String <"Vt50 "> String <"Vt52 "> String <"Vt55 "> String <"Vt61 "> String <"La180"> String <"Vt100"> String <"La120"> String <"Scr0 "> String <"La12 "> String <"La100"> String <"La34 "> String <"La38 "> String <"Vt101"> String <"Vt102"> String <"Vt105"> String <"Vt125"> String <"Vt131"> String <"Vt132"> String <"La50 "> String <"Lqp01"> String <"Lqp02"> String <"Bmp1 "> String <"Vt2xx"> ;T.V2XX = 36 .Rept 41 String <" ? "> .EndR String <"T4115"> ;T.usr0 = 200 moved to 100 and up String <"Vc404"> String <"V550 "> String <"T4010"> String <"DY4 "> String <"Adds "> String <"Hazel"> SusPen: String <"^S"> String <"^O"> TTYbuf: String <>,B .Even TerTyp: .Word 0 ;put terminal type in ascii TermNo: .Byte 0,0 ;terminal number storage String <": ">,E SynErr: String <"Tcr -- Syntax error"> GetErr: String <"Tcr -- get terminal characteristics error,">,B String <" IoSts(1) = ">,C Io1: .BlkB 6 ;place for IoSts word 1 in ascii String <", IoSts(2) = ">,C Io2: .BlkB 6 ;place for IoSts word 2 in ascii String <>,E IdMsg: String <"Tcr -- My current version is ">,B ID: .BlkB 6 ;storage for Ident field String <", built for use on Rsx-11M">,C .IIF DF,R$$MPl String <" PLUS">,C String <>,E Help1: String <"Available commands to Tcr are:"> Help2: String <"All - print info for all terminals"> Help3: String <"Hel[p] - print this message"> help4: String <"ID - Prints Tcr's current version"> Help5: String <"Log - print info for logged on terminals only"> Help6: String <"Sam[ple] - print a sample display showing all chars."> Help7: String <"TI: - print info for your terminal only"> Help8: String <"TTnn: - print info for terminal TTnn: only"> MsgSam: .Ascii "Sample" ;login user's last name for sample .even .PAGE .Sbttl Task Identity Crisis Resolved here Tcr: Finit$ Dir$ #Rcv ;try to get info from mail Bcs 5$ ;if not, we are Terminal characteristics task Jmp Notify ;if we got one, jump, we are NOTIFIER task .Page .SbTTl Terminal Characteristics Print-out Identity ; ; Tcr task, print out info about logged on terminals ; 5$: Mov #Id,R0 ;save Ident field Mov R3,R1 ;get 1st 3 Rad50 characters Call $C5ta ;convert to ascii Mov R4,R1 ;get 2cd 3 Rad50 characters Call $C5ta ;convert to ascii 10$: Mov #CmdBuf,R0 ;point to command buffer Gcml$ #CmdBuf Bcc 20$ ;if no error, jump around CmpB CmdBuf+G.Err,#Ge.Eof ;end of file? Bne 10$ ;if not, error, try again Jmp Exit ;take normal exit 20$: Mov CmdBuf+G.cmld,R3 ;load length of command line Beq 10$ ;if empty, loop back and try again Mov #3*256.,R1 ;skip blanks in command lines ;keywords must match up to 3 chars Mov #LogKtb,R2 ;point to keyword table Mov CmdBuf+G.cmld+2,R4 ;load address of command line Mov #LogSrt,R5 ;point to initial state Clr Mask ;initialize tpars mask .If Df,ParBug ;if Tpars debugger is to be assembled Mov #TDebug,.TpDeb ;point to Tpars debugging trace routine Call .TparD ;parse command line, with Debug .IFF ;if tpars debugger NOT assembled Call .Tpars ;parse command line .EndC ;end of Tpars debugger conditional Bcc 30$ ;if no error, jump around ; ; Tpars syntax error, print line and error message, try again if we can ; Mov #TTYout,R0 ;point to print-out DPB Mov #40,Q.iopl+4(R0) ;use carriage control MovB SynErr,Q.iopl+2(R0) ;get length of string Mov #Synerr+1,Q.iopl(R0) ;starting address Dir$ R0 ;print it Call PriErr ;print syntax error Br 10$ ;get next command line ; ; Command line parsed successfully ; 30$: Mov #"TT,TerTyp ;assume not TI: for now Bit #Hp.Msk,Mask ;was help pleaded for ? Beq 35$ ;if not, jump around Call Help ;print help message Br 10$ ;get next command 35$: Bit #Sa.Msk,Mask ;are we doing a sample? Beq 37$ ;if not, jump around Call Sample ;print a sample Br 10$ ;get next command 37$: Bit #Id.Msk,Mask ;Ident asked for? Beq 40$ ;if not, jump around Print #IdMsg ;print I.D. Br 10$ ;get next command ; ; Check if specific terminal asked for ; 40$: Clr R1 ;initialize terminal counter Bit #TT.Msk,Mask ;was a terminal specified in command line ? Beq 50$ ;if not, jump around Mov TTnum,R1 ;get specified terminal Bit #TI.Msk,Mask ;TI: asked for? Beq 50$ ;if not, jump around Mov TTTyp,TerTyp ;get TI:'s 2 letter code ; ; assign lun to next terminal of interest ; 50$: ALun$s #ChrLun,TerTyp,R1 ;assign lun to terminal Cmp #Ie.Idu,$Dsw ;have we run out of terminals? Bne 60$ ;if not, go around Jmp 10$ ;try to get next command line 60$: Cmp #1,$Dsw ;any other error ? Beq 70$ ;if not, jump around Jmp ExErr ;exit with error status ; ; lun assigned sucessfully, see if we just want logged-on terminals ; 70$: Glun$s #ChrLun,#LunBuf ;get info about terminal Bit #Lg.Msk,Mask ;are we checking only logged in terminals ? Beq 160$ ;if not, jump around check Bit #U2.Log,LunBuf+6 ;is this terminal logged in ? Bne 170$ ;if not, look for next terminal ; ; we want to print info about this terminal ; 160$: Call PrtChr ;print characteristics for 1 TT 170$: Inc R1 ;point to next terminal Bit #TT.Msk,Mask ;are we only checking 1 terminal Bne 180$ ;if so, try and get next command line Jmp 50$ ;loop back for more 180$: Jmp 10$ ;jump back for next command line .Page .SbTTl SAMPLE command - print a sample characteristics display ; ; Sample - put up a representative display for 1 terminal ; Sample: Mov #GmcLth/2,R0 ;get number of WORDS in Sf.gmc buffer Mov #GmcChr,R2 ;point to start of buffer 10$: TstB (R2)+ ;skip past type byte MovB #3,(R2)+ ;put in some bogus characteristics Sob R0,10$ ;loop till all done Mov #1,R1 ;set up terminal as TT1: Bis #Of.Msk!Sl.Msk,Mask ;indicate spooler, offline Call SamChr ;print a sample set of characteristics Return ;exit .Page .SbTTl HELP command - Print a help message Help: Print #Help1 ;print help messages Print #help2 Print #Help3 Print #Help4 Print #Help5 Print #Help6 Print #Help7 Print #Help8 Return .Page .SbTTl PrtChr - print characteristcs for 1 TT ; ; Print terminal number on start of new line ; PrtChr: Mov #GmcLth/2,R0 ;get number of WORDS in Sf.gmc buffer Mov #GmcChr,R2 ;point to start of buffer 1$: Bic #177400,(R2)+ ;clear out old status in buffer Sob R0,1$ ;loop till all done Call GetCar ;if error, will print alternate chars SamChr: Mov #Termno+2,R0 ;point to output storage ClrB -(R0) ;start out with nulls ClrB -(R0) ;ditto Clr R2 ;indicate leading zeros suppressed Mov R1,-(Sp) ;save terminal unit number from $CbTmg Call $CbTmg ;convert binary unit number to ascii Mov (Sp)+,R1 ;restore terminal unit number Mov #TTYbuf+1,R4 ;load address of message MovB TTyBuf,R5 ;load length Cmp R1,#7 ;is this a 1-digit terminal number ? Blos 5$ ;if so, jump around Dec R5 ;print 1 less trailing space 5$: Call Queue ;put into print buffer ; ; Get users last name ; Call LstNam ;print user's last name ; ; Special case code for offline (and spool if MPLUS). ; Since these cases represent get characteristics errors, just ; print terminal number and case keyword. However, if this is a sample ; print-out, print all characteristics. ; Bit #Sa.Msk,Mask ;is this a sample showing? Bne 60$ ;if so, jump around .If Df, R$$Mpl ;if m-Plus Bit #Sl.Msk!Of.Msk,Mask ;offline or spooled ? .IFF Bit #Of.Msk, Mask ;offline ? .Endc Beq 60$ ;if not, jump around ; ; just print spool or offline status, nothing more ; Mov #AltTab,R2 ;get alternate list of keywords Mov #AltChr+1,R3 ;get alternate returned characteristics Br 65$ ;jump to spool check ; ; Print User's terminal speed ; 60$: Mov #KeyTab,R2 ;point to options Mov #GmcChr+1,R3 ;point to returned characteristics .If Df, D$$H11!D$$Z11&T$$Cpw ;if Set /Speed supported MovB (R2)+,R5 ;load string length Mov R2,R4 ;load starting address Call Queue Add R5,R2 ;point to next string Call SpdOut ;print transmit speed Add #2,R3 ;point to receive speed Call SpdOut ;print receive speed Add #2,R3 ;point to terminal type .EndC ;end of speed conditional ; ; Print user's terminal type ; BitB #200,(R3) ;user defined types start at 200 Beq 61$ BicB #200,(R3) ;clear the high bit BisB #100,(R3) ;Set in 100 range 61$: MovB (R2)+,R5 ;load string length Mov R2,R4 ;load starting address Call Queue ;put into print buffer Add R5,R2 ;point to next string Mov #Type,R0 ;use type ascii table Call TypOut ;print terminal type Add #2,R3 ;point to next characteristic .If Df, T$$Vbf&T$$Cpw ;if variable buffer size support ; ; Print user's Buffer size ; MovB (R2)+,R5 ;load string length Mov R2,R4 ;load starting address Call Queue ;put into print buffer Add R5,R2 ;point to next string Mov R1,-(Sp) ;save terminal number Mov R2,-(Sp) ;save keyword pointer Mov #WidBuf,R0 ;point to output buffer Clr R1 ;make sure no sign extension BisB (R3),R1 ;get buffer size Mov #17012,R2 ;3 chars decimal, blank fill leading 0 Call $Cbta ;convert buffer number to ascii Mov (Sp)+,R2 ;restore keyword pointer Mov (Sp)+,R1 ;restore terminal number Mov R0,R5 ;load pointer to end of string Mov #WidBuf,R4 ;point to buffer size string Sub R4,R5 ;compute size of buffer Call Queue Add #2,R3 ;point to next returned characteristic .EndC ;of buffer size conditional ; ; Print if spool device ; 65$: MovB (R2)+,R5 ;load string length Mov R2,R4 ;load starting address Bit #Sl.Msk,Mask ;is this an output spooled device ? Beq 70$ ;if not, jump around Call Queue ;put into print buffer 70$: Add R5,R2 ;point to next string ; ; Indicate whether or not terminal is offline ; MovB (R2)+,R5 ;load string length Mov R2,R4 ;load starting address Bit #Of.Msk,Mask ;unit offline? Beq 75$ ;if not, jump around Call Queue ;put into print buffer 75$: Add R5,R2 ;point to next string ; ; Print suspend status ; .If Df, T$$Syn&T$$Cpw ;if ^S, ^Q support MovB (R2)+,R5 ;load string length Mov R2,R4 ;load starting address TstB (R3) ;are we in resume status ? Beq 80$ ;if so, jump around Call Queue ;put "Spnd=" into buffer 80$: Add R5,R2 ;adjust pointer Mov #SusPen,R0 ;point to suspend messages MovB (R0)+,R5 ;get length of ^Q message Mov R0,R4 ;point to start of message BitB #1,(R3) ;^Q? Beq 90$ ;if not, jump around Call Queue ;put into buffer 90$: Add R5,R0 ;point to next suspend message MovB (R0)+,R5 ;get it's length Mov R0,R4 ;get its address BitB #2,(R3) ;^S? Beq 100$ ;if not, jump around Call Queue ;put in buffer 100$: Add #2,R3 ;point to next characteristic .EndC ;end of ^S, ^Q conditional ; ; Print remaining characteristics ; Mov #NumFea,R0 ;number of fields to print 110$: MovB (R2)+,R5 ;load string length Mov R2,R4 ;load starting address, assume priv. TstB (R3) ;is terminal set to this status ? Beq 120$ ;if not, jump around Call Queue ;put into print buffer 120$: Add R5,R2 ;point to next string Add #2,R3 ;point to next characteristic Sob R0,110$ ;loop back till all printed ; ; Finish line ; Call Flush ;print print buffer Clr QueLen ;start in column 1 again Return ;exit .Page .SbTTl print speed and terminal type subroutines .IF Df, D$$H11!D$$Z11&T$$Cpw ;if DZ or DH in system SpdOut: Mov #Speed,R0 ;point to speed ascii table .EndC ;end of DZ, DH conditional TypOut: 10$: DecB (R3) ;find speed Blt 20$ ;we have it MovB (R0),R5 ;get length of string Add R5,R0 ;point to end of string Inc R0 ;point to start of next string Br 10$ ;loop back for more 20$: MovB (R0)+,R5 ;load length Mov R0,R4 ;load starting address Call Queue ;put it in print queue Return .Page .SbTTl Queue and Flush ;+ ; ; Queue -- queue up some ascii in the print buffer ; ; Inputs: ; R4 = pointer to ascii string ; R5 = length of ascii string ; ; Outputs: ; ; all registers preserved ; print buffer updated ; ;- BufTab = 13. ;set up indentation QueSiz = 80. ;set up size of print buffer QueBuf::.BlkB QueSiz ;print buffer QueLen::.word 0 ;length of stuff in queue Queue:: Call $Saval Mov QueLen,R1 ;get length of stuff in buffer Add R5,R1 ;add in new chars to length Cmp R1,#QueSIz ;is buffer about to overflow Blos 10$ ;if not, jump around Call Flush ;print buffer Mov QueLen,R1 ;re-establish length Add R5,R1 ; 10$: Mov #QueBuf,R0 ;point to print buffer Add QueLen,R0 ;point to first empty byte in buffer 20$: MovB (R4)+,(R0)+ ;transfer ascii to print buffer SoB R5,20$ ;loop till done Mov R1,QueLen ;save new length of buffer Return Flush: Call $Saval ;save all registers Mov #QueBuf,R0 ;point to start of buffer Mov QueLen,R1 ;get length of buffer Beq 30$ ;if empty, just return Add R1,R0 ;find end of strings 10$: CmpB -(R0),#' ;truncate trailing blanks Bne 20$ ;if non-blank, exit loop Sob R1,10$ ;loop till first non-blank 20$: Mov #QueBuf,ttyout+Q.iopl ;store starting address Mov R1,TTyout+Q.iopl+2 ;store length Dir$ #TTYout ;print buffer Mov #QueBuf,R0 ;point to start of buffer Mov #BufTab,R1 ;get size of indentation for ;continuation lines Mov R1,QueLen ;establish fill level 25$: MovB #40,(R0)+ ;fill in with leading blanks Sob R1,25$ ;loop till done 30$: Return .Page .Sbttl Get terminal characteristics from Exec GetCar: Bic #Of.Msk!Sl.Msk,Mask ;assume unit offline, nospool Bit #4000,LunBuf+G.Lucw ;unit a spool device? Beq 5$ ;if so, jump around Bis #Sl.Msk,Mask ;indicate spooler .IIF Df, R$$Mpl Br 40$ ;if M-Plus, don't get chars 5$: Qiow$s #Sf.Gmc,#ChrLun,#ChrEfn,,#TTysts,,<#GmcChr,#GmcLth> Bcc 10$ ;if no syntax errors, jump around Jmp ExErr ;if so, exit with error 10$: Cmp #1,TtySts ;any I/O errors ? Beq 40$ ;if not, jump around and continue onward. Cmp #!,TtySts ;did we ask for illegal characteristics ? Bne 20$ ;if not, jump around ; ; Some terminal hardware does not support all Sf.Gmc characteristics. ; In particular, SET /SPEED is unsupported for DL11 type interfaces. ; The following call does not ask about speeds. ; Qiow$s #Sf.Gmc,#ChrLun,#ChrEfn,,#TTysts,,<#SubChr,#SubLth> Bcs 50$ ;if syntax errors, jump back Cmp #1,TtySts ;any I/O errors ? Bne 50$ ;if so, give up and exit with error Br 40$ ;else all is well, jump ; ; Perhaps the unit is offline ; 20$: Cmp #,TTysts ;is unit offline Bne 50$ ;if not, jump around Bis #Of.Msk,Mask ;indicate unit off line Br 40$ ;exit peaceably ; ; No error, exit with C-bit clear ; 40$: Clc ;indicate all is well Return ; ; Print error message and IoSts contents ; 50$: Mov #6,R2 ;prepare to clear out buffer Mov #Io1+6,R0 ;point just past first ascii error block 60$: ClrB -(R0) ;start out with nulls in buffer Sob R2,60$ ;loop till done, R2 will end up 0, suppression Mov TtySts,R1 ;get first status word Call $Cbomg ;convert to octal magnitude ; ; convert 2cd IoSts word ; Mov #6,R2 ;prepare to clear out buffer Mov #Io2+6,R0 ;point just past second ascii error block 70$: ClrB -(R0) ;start out with nulls in buffer Sob R2,70$ ;loop till done, R2 will end up 0, suppression Mov TtySts+2,R1 ;get second status word Call $Cbomg ;convert to octal magnitude Print #GetErr ;print error message Jmp ExErr ;bye-bye .Page .Sbttl Print user's last name .IF Df, R$$MPl&A$$Cnt ;if M+ accounting .MCall Gin$S,AcnDf$ AcnDf$ ;define accounting offsets UABBuf: .BlkB B.ULen ;define UAB buffer .Even .EndC LstNam: Bit #Sa.Msk,Mask ;is this a sample display ? Beq 10$ ;if not, jump around Mov #MsgSam,R4 ;point to bogus message Br 50$ ;print it 10$: .IF NDF, R$$MPl&A$$Cnt ;if no Rsx-11M Plus accounting ; ; Get user's last name from MAILLOG.Dat and print it ; Inc R1 ;allign record number Open$R #LogFdb ;open login file Get$R #LogFdb,#Blank,#LogSiz,R1,0 ;get logon user's last name Dec R1 ;restore terminal number BcS 20$ ;if error in record, jump TstB Blank ;null entry ? Bne 40$ ;if not, print it 20$: Mov #Blank,R2 ;point to MAILLOG buffer Mov #LogSiz,R3 ;get size of buffer 30$: MovB #' ,(R2)+ ;clear out buffer Sob R3,30$ ;loop till done 40$: Close$ #LogFdb ;make sure we close MAILLOG.DAT Mov #Blank,R4 ;set up for printing .IFF ; ; Get user's last name from User account block in secondary pool ; Mov #UABBuf,R4 ;point to local UAB buffer Gin$S #Gi.UAB,R4,#B.ULen/2,#"TT,R1 BcS 15$ ;if unsuccessful, jump TstB B.Nam(R4) ;is first byte null? Bne 30$ ;if not, all is well, jump 15$: Mov #NamSiz,R5 ;clear out name buffer Mov R4,R2 ;use new pointer 20$: MovB #' ,(R2)+ ;clear out buffer Sob R5,20$ ;loop till done Br 50$ ;print blank name 30$: Add #B.Nam,R4 ;get to start of last name .EndC ;of Plus accounting conditional 50$: Mov #NamSiz,R5 ;ditto Call Queue ;put into print buffer Return .Page .Sbttl Notifier task ; ; Notifier task, tell specified user he has mail ; ; ; Inputs: ; if Rcvd$, notify a user of received mail. ; ; Received data packet: ; RecPkt: .BlkW 2. ;received data packet header from mail DatPkt: .BlkW 13. ;received data packet body from mail ; ; The notifier task is sent the following data packet: ; ; .Byte <0=.LET,1=.Not> ; .Byte ; .Byte ; .BlkB (Maximum of 9. characters) ; The remaining bytes are reserved and undefined. ; Rcv: Rcvd$ ,RecPkt ;DPB for receive data packet Iosts: .BlkW 2 ;Iosts block NotBuf: .Ascii " *** You have a " TypBuf: .BlkB 6 ;either "letter" or "notice" .Ascii " from " SndBuf: .BlkB 14. ;name of sender .Ascii " in you mailbox ***" NotLth= .-NotBuf letter: .Ascii "Letter" Notice: .AScii "Notice" Notify: Open$R #LogFdb ;open the log file Bcs ExErr ;if unable to open, exit with error NotNxt: Mov #DatPkt,R2 ;point to data packet Mov #Letter,R3 ;assume a letter has been sent TstB (R2)+ ;is this a letter ? Beq 110$ ;if so, jump around Mov #Notice,R3 ;if not, it is a notice 110$: Mov #6,R4 ;set up length of string Mov #TypBuf,R1 ;point to ascii storage 120$: Movb (R3)+,(R1)+ ;fill in type Sob R4,120$ ;loop back till done MovB (R2)+,R1 ;get sender's terminal number Inc R1 ;first record is 1, not 0 Get$R #LogFdb,#SndBuf,#LogSiz,R1,0 ;get his logon last name ; ;get rid of trailing blanks in sender's last name ; Mov #SndBuf,R1 ;point to sender's last name Mov #LogSiz,R0 ;get size of name entry 125$: CmpB #' ,(R1)+ ;check for space BNe 127$ ;if not, jump around ClrB -1(R1) ;replace with null 127$: Sob R0,125$ ;loop back till done MovB (R2)+,R3 ;get length of receiver last name Mov #1,R1 ;start at front of file Mov R2,-(Sp) ;save address of receiver string 130$: Get$R #LogFdb,#Blank,#Logsiz,R1,0 ;get next record in file Bcs ExErr ;if error, exit with error status Mov R3,R4 ;set up compare loop counter Mov #Blank,R5 ;point to name just read in 140$: CmpB (R2)+,(R5)+ ;see if we have a match Bne 150$ ;if not, jump out Sob R4,140$ ;loop back till done Tst (Sp)+ ;get rid of garbage ; ; if we fall through to here, we have a match ! ; Alun$s #BrkLun,#"TT,R1 ;assign to receiver terminal Bcs ExErr ;if error, exit QioW$S #IO.Wbt,#BrkLun,#BrkEfn,,IOSTS,,<#NotBuf,#NotLth> Bcs ExErr ;if error, jump around Cmp #1,Iosts ;any I/O errors Bne ExErr ;if so, jump around Br Exit ;good exit 150$: Inc R1 ;point to next record Mov (Sp),R2 ;get pointer to start of string Br 130$ ;go back and get next record Exit: Dir$ #Rcv ;try and get next packet Bcc NotNxt ;if we get one, go back Close$ #LogFdb ExSt$s #Ex$Suc ExErr: Close$ #LogFDB ExSt$s #Ex$Err ;indicate error .PAGE .SBTTL File I/O Macros and processing LogSiz=14. ;size of entry in log file FDOF$L ;DEFINE FDB OFFSETS FCSBT$S ;DEFINE FDB BIT PARAMETERS LogFDB: FDBDF$ ;DEFINE FDB FOR Log file FDAT$A R.fix,,LogSiz ;define type and size of records FDRC$A FD.ran,Blank,LogSiz ;BUFFER LOCATION,LENGTH ;MOVE MODE SPECIFIED BY DEFAULT FDOP$A FilLun,DatDsc,,,fa.dlk FDBF$A FilEfn ;FCS EVENT FLAG FOR THIS FILE DATDSC: .WORD DEVSIZ,DEVNAM ;DEVICE NAME DESCRIPTOR .WORD DIRSIZ,DIRNAM ;UIC DESCRIPTOR .WORD FILSIZ,FILNAM ;FILE NAME DESCRIPTOR DEVNAM: .ASCII "DM1:" DEVSIZ= .-DEVNAM DIRNAM: .ASCII "[010,003]" DIRSIZ=.-DIRNAM FILNAM: .ASCII "MAILLOG.DAT" FILSIZ=.-FILNAM Blank: .Rept LogSiz .byte 0 .EndR .even .Page .SbTtl Tpars State Tables .MCALL ISTAT$,STATE$,TRAN$ .If DF, ParBug ISTAT$ LogSTB,LogKTB,$DEBUG .IFF ISTAT$ LogStb,LogKtb .EndC ;end of ParBug conditional State$ LogSrt Tran$ '/,LogSrt Tran$ 'T,TTsta Tran$ "ID",$Exit,,Id.Msk,Mask Tran$ "LOG",$EXIT,,Lg.Msk,Mask Tran$ "ALL",$Exit,,Al.Msk,Mask Tran$ "HELP",$EXIT,,Hp.Msk,Mask Tran$ "SAMPLE",$Exit,,Sa.Msk,Mask State$ TTsta Tran$ 'T,TTunit Tran$ 'I,TTcol,TiGet,TI.Msk,Mask State$ TTunit Tran$ $Numbr,TTcol,Unitno State$ TTcol Tran$ ':,$Exit,,TT.Msk,Mask State$ .Page .SbTtl Tpars action routines UnitNo: Mov .Pnumb,TTnum ;store terminal number Return TiGet: GLun$S #5,#LunBuf ;get TI: info Mov LunBuf,TTTyp ;get device 2-letter code MovB LunBuf+2,TTNum ;get terminal number Return .Page .SbTTl Tpars Debugger ;+ ; ; *** TDebug -- The Tpars Debugger ; ; Inputs: ; R3 = Length of remainder of input string ; R4 = Address of remainder of input string ; R5 = Current address of Transition table ; ; Outputs: ; The following is printed for every Tpars State transition: ; ; Current Transition table Address = (some octal address) ; Tcr TT34: ; .......^..... ; ;- Pointr: .Rept 72. .Byte '. .EndM .IF Df,ParBug ;if Tpars debugger to be asembled TraAdd: String <"Current Transition Table Address = ">,B AddBuf: .BlkB 6 ;storage for octal ASCII address String <>,E .even TDebug: Call $Saval ;save all of the registers Mov #40,TTyout+Q.iopl+4 ;ask for lf and cr Mov R5,R1 ;get transition address Sub #LogStb,R1 ;get rid of Bias Mov #AddBuf,R0 ;point to output buffer Clr R2 ;suppress leading zeros Call $CBOMG ;convert binary to octal ASCII Print #TraAdd ;print transition address .EndC ;end of tpars debugger conditional PriErr: Print CmdBuf+G.cmld+2,CmdBuf+G.cmld ;print entire line to be parsed Sub CmdBuf+G.cmld+2,R4 ;calculate relative address of remainder MovB #'^,Pointr(R4) ;point to remainder of string Inc R4 ;adjust pointer Print #Pointr,CmdBuf+G.cmld ;print the pointer Dec R4 ;restore pointer MovB #'.,Pointr(R4) ;restore default character Return .End Tcr