.title line parameter handler ; DECUS C Calling Format ; ; jsr r5,csv$ ;save r2,r3, and r4 ; ;r5 is parameter base ; ;c$pmtr(r5) is first argument ; ;c$pmtr+2(r5) is second argument ; ;... ; ;return args in r0 ; ... ; user code ; ... ; ; jmp cret$ ;restore r2-r5 and return ; rts pc ;does the same (cret$ follows csv$) ; ; csv$ and cret$ need be used only if arguments are used ; .include "os.mac" ; This is an extension of SLUNIO.MAC for use ; with the RPORT service. ; ; Call this function after sl_init(). ; ; linset(n,code) ; ; code - (OPLxSSSS) ; ; SSSS - baud rate code (octal) ; ( 0 50 ) ; 1 75 ; 2 110 ; 3 134.5 ; 4 150 ; 5 300 ; 6 600 ; 7 1200 ; 10 1800 ; 11 2000 ; 12 2400 ; 13 3600 ; 14 4800 ; 15 7200 ; 16 9600 ; ( 17 19200 ) ; note: not all controllers support all ; baud rate values, check device ; documentation. ; ; L - 0 for 7-Bit ; - 1 for 8-Bit ; ; P - 0 for no parity ; - 1 for parity ; ; O - 0 even parity (when P = 1) ; - 1 odd parity (when P = 1) ; ; ; n - is the line/unit number ; .sbttl linset .if ne ts$sys CLIUNT = 13 ;Channel # for CL unit input CLOUNT = 12 ;Channel # for CL unit output CLCTRL = 11 ;Channel # for CL unit control CLRXNF = 201 ;SPFUN code to clear XOFF / send XON CLSPRM = 256 ;SPFUN code to set line parameters .psect c$code linset:: jsr r5,csv$ ; n not used (TSX ONLY) mov c$pmtr+2(r5),linprm ; line parameters mov #clsls,r0 ; Set Line Parameters emt 375 mov #clrhnd,r0 ; Reset XOFF / Send XON emt 375 rts pc .psect c$data linprm: .word 0 clsls: .byte CLCTRL,32 ; .spfun for CLSPRM .word 0 .word linprm .word 0 .byte 377,CLSPRM .word 0 clrhnd: .byte CLCTRL,32 ; .spfun for CLRXNF .word 0 .word 0 .word 0 .byte 377,CLRXNF .word 0 .endc .if ne rt$sys .psect c$code linset:: jsr r5,csv$ mov c$pmtr(r5),clmget+4 ; unit number mov c$pmtr(r5),clmset+4 mov c$pmtr+2(sp),linprm ; line parameters mov #clmget,r0 ; Get the Line Parameters emt 375 mov #stsblk,r1 ; stsblk address bic #7400,(r1) ; mask old baud rate mov linprm,r0 ; isolate the baud rate swab r0 bic #^C7400,r0 bis r0,(r1)+ ; set new baud rate bic #33,(r1) ; mask old length and parity bis #2,(r1) ; 7 bits / no parity mov linprm,r0 bit #40,r0 beq 1$ bis #1,(r1) ; 8 bits 1$: ash #-3,r0 ; position parity bic #^C30,r0 ; mask parity bis r0,(r1) ; set parity mov #clmset,r0 ; set parameters emt 375 rts pc .psect c$data linprm: .word 0 clmget: .byte 1,37 ; .mtget .word stsblk .word 0 ; unit number clmset: .byte 0,37 ; .mtset .word stsblk .word 0 ; unit number stsblk: .blkw 4 ; status block .endc .end