.TITLE TTYTST test routines for TTYDRV .LIST ME .ENABL REG .LIBRARY /SYSCLL.SML/ .LIBRARY /IOSYS.SML/ .LIBRARY /CALL.SML/ .LIBRARY /MEMORY.SML/ .LIBRARY /JOBCTL.SML/ .LIBRARY /TTYCTL.SML/ .MCALL $EXIT .MCALL $M$ALLO,$M$FREE,$P$INIT,$P$ALLO,$P$ERR .MCALL .IMAGE,.CALL,.RETRN .MCALL $IOREQ,$OPEN,$CLOS,$WRIT,$READ,$MODE,$BSIZ .MCALL .IOSYS,.IOFUNC,.IOCLR,.IOERR .MCALL $SYS .MCALL .TTYMOD .MCALL $WAIT .IOSYS .IOFUNC .IOERR .TTYMOD .IMAGE TTYTST .CSECT TTYTST: $M$ALLO #0,#200,#^RUSR,#^RT$P,#^ROOL BCS . 1$: $P$INIT R0,#200,#20 .IOCLR #IORQP MOV #IORQP,R4 $CLOS #IORQP BCS . 2$: $OPEN #IORQP,#^RTTY,#^R000,#^RTTY BCC 6$ $WAIT #^RTTY,#^R000 BR 2$ 6$: MOVB R0,IORQP MOV #4,LCOUNT 11$: MOV #10,R4 MOV #ABUF,R3 12$: $WRIT #IORQP,R4,(R3)+ BCS . 13$: SOB R4,12$ 3$: MOV #STRBUF,R3 4$: TST (R3) BEQ 5$ $WRIT #IORQP,(R3)+,(R3)+ BCS . BR 4$ 5$: $READ #IORQP,#120,#LINBUF BCS . 9$: MOV R0,R3 $WRIT #IORQP,#2,#CRLF BCS . 20$: $WRIT #IORQP,R3,#LINBUF BCS . 23$: $WRIT #IORQP,#2,#CRLF BCS . 24$: $MODE #IORQP,#T$ECHO!T$LINE!T$COOK!T$DELM BCS . 21$: $READ #IORQP,#120,#LINBUF BCS . 22$: MOV R0,R3 $WRIT #IORQP,#2,#CRLF BCS . 10$: $WRIT #IORQP,R3,#LINBUF BCS . 25$: $WRIT #IORQP,#2,#CRLF BCS . 26$: $MODE #IORQP,#T$LINE!T$COOK BCS . 14$: $READ #IORQP,#10,#LINBUF BCS . 15$: $WRIT #IORQP,R0,#LINBUF BCS . 27$: $WRIT #IORQP,#2,#CRLF BCS . 28$: $MODE #IORQP,#T$ECHO!T$LINE BCS . 16$: $READ #IORQP,#120,#LINBUF BCS . 17$: MOV R0,R3 $WRIT #IORQP,#2,#CRLF BCS . 18$: $WRIT #IORQP,R3,#LINBUF BCS . 29$: $WRIT #IORQP,#2,#CRLF BCS . 30$: $MODE #IORQP,#0 BCS . 19$: MOV #120,R4 31$: $READ #IORQP,#1,#0 BCS . 32$: MOVB R0,LINBUF $WRIT #IORQP,#1,#LINBUF BCS . 33$: DEC R4 BNE 31$ $MODE #IORQP,#T$ECHO!T$LINE!T$COOK BCS . 34$: $WRIT #IORQP,#2,#CRLF BCS . 35$: DEC LCOUNT BEQ 36$ JMP 11$ 36$: $WRIT #IORQP,#1170,#LARGE BCS . $CLOS #IORQP BCS . $WRIT #IORQP,#2,#CRLF BCC . $EXIT .PSECT DATA IORQP: .BLKW 10 LCOUNT: .BLKW 1 ABUF: .WORD A1 .WORD A2 .WORD A3 .WORD A4 .WORD A5 .WORD A6 .WORD A7 .WORD A8 STRBUF: .WORD 2 .WORD CRLF .WORD 10 .WORD GRUMPF .WORD 12 .WORD SCHRUM .WORD 7 .WORD BEISS .WORD 2 .WORD CRLF .WORD 1170 .WORD LARGE .WORD 0 LINBUF: .BLKB 121 GRUMPF: .ASCIZ /grumpf. / SCHRUM: .ASCIZ /schrumpf. / BEISS: .ASCIZ /beiss. / CRLF: .ASCIZ <15><12> A1: .ASCIZ /01234567/ A2: .ASCIZ /89ABCDE/ A3: .ASCIZ /FGHIJK/ A4: .ASCIZ /LMNOP/ A5: .ASCIZ /QRST/ A6: .ASCIZ /UVW/ A7: .ASCIZ /XY/ A8: .ASCIZ /Z/ LARGE: .ASCII /This is a large text. Its only purpose is to test how good the system/ .ASCII <15><12> .ASCII /can handle large buffers. So, 10 lines of text are not really large,/ .ASCII <15><12> .ASCII /but it should be large enough. Whenever an error condition occurs/ .ASCII <15><12> .ASCII /the system will imediately halt, so that one can peek around in/ .ASCII <15><12> .ASCII /memory to find the error. For example, printing the large buffer/ .ASCII <15><12> .ASCII /can cause the buffer pool to be exhausted, which would mean that/ .ASCII <15><12> .ASCII /the whole system will stop working sooner or later. This is because/ .ASCII <15><12> .ASCII /nearly all parts of the system use the buffer pool to allocate/ .ASCII <15><12> .ASCII /buffers of different sizes for temporary or permanent storage of/ .ASCII <15><12> .ASCII /all kinds of data. Grumpf./ .ASCIZ <15><12> .END TTYTST