$MACRO TTYPE IFB TTP+1 = ##@1 TYPE " Terminal is #@2" #0 JMP TEND FI $ENDM ; $MACRO FLAG m1 m2 flag IFB #@3+1 = #0 I%NB <#@1> ELSE I%NB <#@2> FI $ENDM ; $MACRO SPD A B IF R2 = ##@1 MOV ##@2,R2 RTS PC FI $ENDM ; $MACRO g item #@1: .byte tc.#@1,0 $ENDM ; $MACRO gg ** g #@1 #@2 #@3 #@4 #@5 #@6 #@7 #@8 #@9 $ENDM / PROGRAM gty ;get tty char (why did I have to write this) .psect tty .mcall qiow$,dir$,ttsym$,alun$,glun$ ttsym$ glun: glun$ 1,buf alun: alun$ 1,TT,0 end: .byte 12,15,177,0 null: .word 177 buf: .blkb 100. get: qiow$ sf.gmc,1,1,,ios,, ios: .word 0,0 i: .word 0 j: .word 0 get1: gg acr bin cts dlu gg esq fdx hff gg hfl hht hld isl gg lpp nec pri gg rat rsp scp slv gg smr tbf ttp gg vfl wid xsp getl: EBC: .BYTE TC.8BC,0 MAIN:: FUNC ARGC,ARGV IF argc(r5) GT #1 mov argv(r5),r2 add #2,r2 mov (r2),r2 ;get addr of arg 2 (tty #) LEN r2 ;;;; C r3 = btoi[r2,r0,#i,#8.] ;lets do this locally call term mov i,alun+a.lunu ;set tt# dir$ #alun ;and assign it ELSE dir$ #glun movb buf+g.lunu,i ;set tty number clrb i+1 FI LOOP FOR r3 = #get1 THRU #getl STEP #2 mov r3,get+q.iopl ;get char 1 at a time dir$ #get NEXT r3 movb isl+1,j clrb j+1 PRINTF "Characteristics for tt%o: Interface subline = %o (8)" i,j FLAG acr FLAG <> bin FLAG <> cts FLAG dlu FLAG <> esq FLAG fdx FLAG hff FLAG hht FLAG <> hld FLAG <> nec FLAG <> pri FLAG scp FLAG <> slv FLAG smr FLAG <> vfl FLAG <> ebc movb tbf+1,r3 IF r3 NE #0 PRINTF " Typeahead (current count = %d)" r3 ELSE FLAG <> rat FI TYPE "_<12>_" #0 movb rsp+1,r2 call speed . SPRINT[#BUF, "Receive speed= %4d " r2] TYPE #buf #0 movb xsp+1,r2 call speed . SPRINT[#BUF, "Transmit speed= %4d " r2] TYPE #buf #0 movb wid+1,r2 bic #177400,r2 . SPRINT[#BUF, "Buffer width= %d." r2] TYPE #buf #0 TYPE "_<15>__<12>_" #0 movb hfl+1,r2 . SPRINT[#BUF, "Fill count: %d. " r2] TYPE #buf #0 movb lpp+1,r2 bic #177400,r2 . SPRINT[#BUF, "Page length: %4d. " r2] TYPE #buf #0 TTYPE 1 TTYPE 2 TTYPE 3 TTYPE 4 TTYPE 5 TTYPE 6 TTYPE 7 TTYPE 10 TTYPE 11 TTYPE 12 TTYPE 13 TTYPE 14 TTYPE 15 TTYPE 16 Tend: TYPE "_<15>_" #0 RET #1 speed: SPD S.0 0. SPD S.50 50. SPD S.75 75. SPD S.110 110. SPD S.134 134. SPD S.150 150. SPD S.200 200. SPD S.300 300. SPD S.600 600. SPD S.1200 1200. SPD S.1800 1800. SPD S.2000 2000. SPD S.2400 2400. SPD S.3600 3600. SPD S.4800 4800. SPD S.7200 7200. SPD S.9600 9600. RTS PC term: ;convert terminal number to binary ;do it this way since there ain't no conversion ;short of using Whitesmiths ;and we want to give this one away. clr r3 LOOP FOR j = #1 TO R0 movb (r2)+,r1 ;get char sub #'0,r1 ;make it a binary asl r3 asl r3 asl r3 ;multiply r3 by 8 add r1,r3 ;and add this char NEXT j mov r3,i ;store result in i rts pc .end