.TITLE TTZ DZ11 asynchronous multiplexor driver .NLIST BEX .ENABL LC ; ; Pdp11/dcn dz11 asynchronous multiplexor driver ; ; This driver operates as part of the terminal input/output processes. ; ; In image mode bytes are copied to and from the device uninterpreted and ; unmodified. Two ascii modes are povided: dte, which emulates a terminal ; for a remote processor, and dce, which emulates a processor for a remote ; terminal. In this driver both dte and dce modes operate in the same way. ; ; Dz11 parameter regions are assigned one after the other by line starting ; with line 0, which also carries the vector assignment. All lines carry the ; register assignment, output control bit (parset) and line parameter register ; (parlpr). ; ; External symbols ; .GLOBL IORINI,IOXINI,CPUPSA .GLOBL MUXINP,TTRSIO,TTXINT,TTXSIO,TTXASY ; ; Entry symbols ; .GLOBL DZRPAT ;input process control vector .GLOBL DZXPAT ;output process control vector ; ; System definitions ; .ASECT .MCALL .COM,.PSA,.TTD,.TTP,.PAT ;dcnlib definitions .MCALL .SETV ;dcnlib maccors .COM ;define common data .PSA ;define process data areas .TTD ;define asynch i/o data areas .TTP ;define tty data areas ; ; Module definitions ; BUFSIZ = 100 ;input buffer size (power of 2) ; ; Tty process save area extension (ttr) ; . = TTREND .EVEN TTRGET: .BLKB 1 ;get pointer TTRPUT: .BLKB 1 ;put pointer TTRCNT: .BLKB 1 ;count of bytes in buffer TTRINB: .BLKB BUFSIZ ;input buffer .EVEN .BLKW REGEND/2+6 ;process stack TTRENP = . ;end of tty input extension ; ; Tty process save area extension (ttx) ; . = TTXEND .BLKW REGEND/2+6 ;process stack TTXENP = . ;end of tty output extension ; ; Device registers (dz11) ; . = 0 TTRCSR: .BLKW 1 ;control/status register TIE = 040000 ;transmitter interrupt enable RIE = 000100 ;receiver interrupt enable MSE = 000040 ;master scan enable TTRBUF: .BLKW 1 ;receiver buffer register (read-only) TTLPAR = TTRBUF ;line parameter register (write-only) RXENAB = 010000 ;receiver enable TTXCSR: .BLKW 1 ;transmitter control register TTXMSR: .BLKW 1 ;modem status register (read-only) TTXBUF = TTXMSR ;transmitter data register (write-only) .PAGE ; ; Procedure segments ; ; Supervisor-state procedure ; Dsects: r2 = dev, r3 = par, r4 = reg, r5 = psa ; .PSECT $KERI,RO,I ; ; Initialization ; TTRNIT: MOV PARLPR(R3),-(SP) ;set line parameters MOV @SP,TTLPAR(R2) BIC #^C7,@SP MOV #1,R1 ASH (SP)+,R1 MOVB R1,PARSET(R3) BISB R1,TTXCSR+1(R2) ;(dtr) TST R0 ;is this first line BEQ TTX33 ;branch if no MOV #TIE+RIE+MSE,TTRCSR(R2) ;yes. start scanner BR TTX44 ; TTXNIT: TST R0 ;is this first line BEQ TTX33 ;branch if no ADD #4,R0 ;offset to transmit interrupt vector TTX44: MOV #INTR,R1 ;allocate interrupt vector .SETV TTX33:: RTS PC ; ; Mux input interrupt ; TTRINT: MOV TTRBUF(R2),R0 ;get byte MOV R0,R1 ;extract line number SWAB R1 BIC #^C7,R1 ASH #2,R1 ;compute pid MOVB PSAPID(R5),R4 ADD R4,R1 BIC #^C376,R1 ;set base registers MOV CPUPSA(R1),R5 MOV PSASTK(R5),R4 MOV PSAPAR(R5),R3 JMP MUXINP ;continue in tty ; ; Mux output interrupt ; TTZINT: MOV TTRCSR(R2),R1 ;get line number SWAB R1 BIC #^C7,R1 ASH #2,R1 ;compute pid MOVB PSAPID(R5),R4 ADD R4,R1 MOV CPUPSA(R1),R5 ;set base registers MOV PSASTK(R5),R4 MOV PSAPAR(R5),R3 JMP TTXINT ;continue in tty .PAGE ; ; Data segment ; .PSECT $KERD,RO,D ; ; Process headers ; DZRPAT: .PAT TTRENP,IORINI,PRI3,<0,0,TTRNIT,TTRSIO,TTRINT> DZXPAT: .PAT TTXENP,IOXINI,PRI3,<0,TTXASY,TTXNIT,TTXSIO,TTZINT> ; .END