.title k11stt the SET command .ident /2.0.05/ .include /IN:K11MAC.MAC/ .include /IN:K11CDF.MAC/ .enabl gbl .enabl lc .psect $code $cmglob = 0 ; Copyright (C) 1984 Change Software, Inc. ; ; 31-Jan-84 15:13:45 Brian Nelson ; ; Removed SET command code from K11CMD.MAC for space saving via ; placement into an overlay. .sbttl the set command .enabl lsb c$set:: $name call loaset calls getcm0 ,<#argbuf,r0> mov r0 ,r2 bmi 110$ call loaset calls getcm1 ,<#argbuf,r0,r2> tst r0 bmi 110$ jsr pc ,@r1 tst r0 beq 100$ message ,cr 100$: return 110$: message ,cr return .dsabl lsb .psect $code .sbttl set a line for dilaing out and speed .enabl lsb set$li::copyz #argbuf ,#ttname,#20 ; copy the device name please copyz #argbuf ,#ttdial,#20 ; save it here permanatlely calls assdev ,<#ttname> ; try to get the exec to allocate it tst r0 ; did the allocation work ? beq 10$ ; no message direrr r0 ; print out the directive error return ; and exit 10$: message ; ack the command print #ttname ; print the device name message ; and exit calls noecho ,<#ttname> ; try to disable echoing tst r0 ; did it work ? beq 20$ ; yes message direrr r0 20$: clr remote ; no longer are we remote calls ttpars ,<#ttname> ; see if the terminal is KB: or TI: cmpb r0 ,#377 ; well ? bne 100$ ; no mov sp ,remote ; yes, we are now the remote system calls gttname ,<#ttname> ; get our local terminal number copyz #ttname ,#ttdial ; and update it please message ,cr 100$: clr r0 return .dsabl lsb .enabl lsb set$sp::calls l$val ,<#argbuf> ; get the speed into decimal tst r0 ; ok ? bne 30$ ; yes call ttchk ; is a line assigned now ? bcs 100$ ; no calls setspd ,<#ttname,r1,#lun.co>; set the speed please tst r0 ; did it work ? beq 100$ ; yes, exit cmp r0 ,#377 ; bad speed ? beq 30$ direrr r0 br 100$ 30$: message ,cr 100$: clr r0 return global .dsabl lsb ttchk: tstb ttname ; insure a line is set beq 10$ ; ok clc return 10$: message ,cr sec return global .sbttl set debug whatever set$de::calls getcm0 ,<#argbuf,#dbglst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no calls getcm1 ,<#argbuf,#dbglst,r0> tst r0 ; now get arguement if needed bmi 110$ ; oops jsr pc ,@r1 ; dispatch now return ; bye 110$: call sd$hel ; error, print a help and exit clr r0 ; say we have no errors return ; bye .enabl lsb ; for message macro in SDOPEN sdopen: bit #log$op ,trace ; a logfile open ? bne 200$ ; yes message ,cr clr r0 ; and exit with carry set sec ; error exit return ; bye 200$: clc ; return with file status open return ; bye .dsabl lsb $cmglob = 0 ; don't make these routines global command dbglst ,ALL ,3 ,sd$all command dbglst ,CONSOLE,3 ,sd$con command dbglst ,CONNECT,3 ,sd$con command dbglst ,FILE ,3 ,sd$fil command dbglst ,HELP ,3 ,sd$hel command dbglst ,NONE ,3 ,sd$none command dbglst ,OFF ,3 ,sd$off command dbglst ,ON ,2 ,sd$on command dbglst ,PACKET ,3 ,sd$pak command dbglst ,RAW ,3 ,sd$raw command dbglst ,RPACK ,3 ,sd$rpa command dbglst ,STATE ,3 ,sd$sta command dbglst ,TERMINAL,3 ,sd$ter command dbglst ,NOTERMINAL,3 ,sd$not command dbglst .sbttl routines for SET DEBUG .enabl lsb sd$none: sd$off::bic #log$al ,trace ; clear all debug bits now bit #log$op ,trace ; is there a log file open ? beq 20$ ; no calls close ,<#lun.lo> ; close it bic #log$op ,trace ; say it's closed please message ,cr 20$: clr r0 return sd$all: sd$on: bic #log$al ,trace ; insure previous logfile closed call rawchk ; disallow other logging if raw logging bcs 100$ ; oops call sdopen ; a debug file already open ? bcs 100$ ; no bis #log$al ,trace ; set debug on turns the world on clr r0 100$: return sd$ter: mov sp ,debug ; i/o to local kermit terminal clr r0 return sd$not: clr debug clr r0 return global .dsabl lsb .sbttl more set debug routines ; SD$CON enable logging of virtual connect i/o to disk file ; ; SD$PAK enable logging of all packets to disk file ; ; SD$STA enable logging of all states to disk file sd$con: call sdopen ; logfile open ? bcs 100$ ; no bis #log$co ,trace ; yes, set console emulation logging clr r0 100$: return sd$fil: call sdopen ; logfile open ? bcs 100$ ; no call rawchk ; disallow other logging if raw logging bcs 100$ ; oops bis #log$fi ,trace ; yes, set file opens and creates clr r0 100$: return sd$pak: call sdopen ; logfile open bcs 100$ ; no call rawchk ; disallow other logging if raw logging bcs 100$ ; oops bis #log$pa ,trace ; yes, set packet logging on clr r0 100$: return sd$sta: call sdopen ; logfile open bcs 100$ ; no call rawchk ; disallow other logging if raw logging bcs 100$ ; oops bis #log$st ,trace ; yes, set state logging on clr r0 100$: return .sbttl check for oding raw terminal i/o dumps .enabl lsb sd$raw: call sdopen ; logfile open bcs 100$ ; no mov trace ,r0 bic #log$op ,r0 tst r0 beq 10$ message message br 100$ 10$: bis #log$io ,trace ; yes, set state logging on calls close ,<#lun.lo> calls create ,<#logfil,#lun.lo,#binary> ; redo as image file message ,cr 100$: clr r0 return rawchk: bit #log$io ,trace beq 200$ message ,cr sec return 200$: clc return sd$rpa: bis #log$rp ,trace clr r0 return sd$hel: message message ,cr message < Connection logging SET DEBUG CONSOLE>,cr message < File opens/creates SET DEBUG FILE>,cr message < Packet traffic SET DEBUG PACKET>,cr message < Raw terminal i/o SET DEBUG RAW>,cr message < State transitions SET DEBUG STATE>,cr message message ,cr message ,cr message ,cr message return .dsabl lsb .sbttl set parity here .enabl lsb set$pa::call ttchk ; insure a line is set bcs 100$ ; no, they must set line first 10$: calls getcm0 ,<#argbuf,#parlst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now cmpb r0 ,#par$no ; no parity ? if so, no further checking beq 20$ ; ok cmpb $image ,#binary ; parity. is image mode turned on now? bne 20$ ; no message ,cr message ,cr br 100$ ; bye 20$: mov r0 ,parity ; save for the show command ;- calls ttypar ,<#ttname,r0> ; set parity now (removed 28-Mar-84 BDN) ;- tst r0 ; did that work ? ;- beq 100$ ; yes ;- direrr r0 ; no, issure a perhaps useful message 100$: clr r0 ; exit with no error set return 110$: message ,cr return .dsabl lsb cm$glob = 0 command parlst ,EVEN ,3 ,spa$ev command parlst ,ODD ,3 ,spa$od command parlst ,MARK ,3 ,spa$ma command parlst ,SPACE ,3 ,spa$sp command parlst ,NONE ,3 ,spa$no command parlst spa$ev: mov #par$ev ,r0 ; set parity even return spa$od: mov #par$od ,r0 ; set parity odd return spa$ma: mov #par$ma ,r0 ; set parity mark return spa$sp: mov #par$sp ,r0 ; set parity space return spa$no: mov #par$no ,r0 ; set parity none return global .sbttl set handshake and duplex set$ha::call ttchk ; insure a line is set bcs 100$ ; no, they must set line first 10$: calls getcm0 ,<#argbuf,#hanlst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now movb r0 ,handch ; save for the show command 100$: clr r0 ; exit with no error set 110$: return cm$glob = 0 command hanlst ,NONE ,3 ,sha$no command hanlst ,XON ,3 ,sha$xn command hanlst ,XOFF ,3 ,sha$xf command hanlst ,CARRIAGE-RETURN,3 ,sha$cr command hanlst ,CARRIAGE_RETURN,3 ,sha$cr command hanlst sha$no: clrb r0 ; no handshake (the default) return sha$xn: movb #'Q&37 ,r0 ; wait for an XON return sha$xf: movb #'S&37 ,r0 ; wait for an XOFF (??) return sha$cr: movb #cr ,r0 ; wait for a carriage return return set$du::call ttchk ; insure a line is set bcs 100$ ; no, they must set line first 10$: calls getcm0 ,<#argbuf,#duplst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now 100$: clr r0 ; exit with no error set 110$: return sdu$ha: mov sp ,duplex ; simple return sdu$fu: clr duplex ; the default return $cmglob = 0 command duplst ,FULL ,3 ,sdu$fu command duplst ,HALF ,3 ,sdu$ha command duplst global .sbttl set block-check-type set$bl::calls getcm0 ,<#argbuf,#blklst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now clr r0 ; no errors 110$: return $cmglob = 0 command blklst ,1_CHARACTER_CHECKSUM ,1 ,sbl$1 command blklst ,2_CHARACTER_CHECKSUM ,1 ,sbl$2 command blklst ,3_CHARACTER_CRC_CCITT ,1 ,sbl$3 command blklst ,1-CHARACTER-CHECKSUM ,1 ,sbl$1 command blklst ,2-CHARACTER-CHECKSUM ,1 ,sbl$2 command blklst ,3-CHARACTER-CRC-CCITT ,1 ,sbl$3 command blklst ,ONE_CHARACTER_CHECKSUM ,3 ,sbl$1 command blklst ,TWO_CHARACTER_CHECKSUM ,3 ,sbl$2 command blklst ,THREE_CHARACTER_CRC_CCITT,3 ,sbl$3 command blklst ,ONE-CHARACTER-CHECKSUM ,3 ,sbl$1 command blklst ,TWO-CHARACTER-CHECKSUM ,3 ,sbl$2 command blklst ,THREE-CHARACTER-CRC-CCITT,3 ,sbl$3 command blklst sbl$1: movb #'1 ,setrec+p.chkt movb #'1 ,setsen+p.chkt return sbl$2: movb #'2 ,setrec+p.chkt movb #'2 ,setsen+p.chkt return sbl$3: movb #'3 ,setrec+p.chkt movb #'3 ,setsen+p.chkt return global .sbttl set dtr and hangup line set$dt::call ttchk ; must have already done a SET LINE bcs 100$ ; oops calls ttydtr ,<#ttname> ; try to raise DTR on the line tst r0 ; did it work ? beq 100$ ; yes direrr r0 ; no, emit a message as to why 100$: clr r0 ; and exit return c$disc:: c$hang::$name set$hu::call ttchk ; must have already done a SET LINE bcs 100$ ; oops calls ttyhang ,<#ttname> ; try to hang up the line tst r0 ; did it work ? beq 100$ ; yes direrr r0 ; no, emit a message as to why clr r0 return 100$: message print #ttname message < disconnected>,cr return global .sbttl set filetype set$fi::calls getcm0 ,<#argbuf,#setfil> tst r0 ; did we find a keyword ? bmi 100$ ; no jsr pc ,@r1 ; yes, dispatch on it please 100$: return sf$asc: mov #text ,$image ; imagemode := false clr r0 ; no errors return ; bye .enabl lsb sf$bin: tstb parity ; can't have parity set for this beq 10$ ; ok cmpb parity ,#par$no ; has it been set to none ? beq 10$ ; yes message ,cr br 100$ ; bye 10$: call chkpar ; further check for hardware parity tst r0 ; r0 <> 0 if hardware parity is on. beq 20$ ; ok message ,cr br 100$ ; bye 20$: mov #binary ,$image ; imagemode := true 100$: clr r0 ; no errors return ; bye .dsabl lsb command setfil ,7_BIT ,3 ,sf$asc command setfil ,7-BIT ,3 ,sf$asc command setfil ,8_BIT ,3 ,sf$bin command setfil ,8-BIT ,3 ,sf$bin command setfil ,ASCII ,3 ,sf$asc command setfil ,BINARY ,3 ,sf$bin command setfil ,EIGHT ,3 ,sf$bin command setfil ,SEVEN ,3 ,sf$asc command setfil ,EIGHT_BIT ,3 ,sf$bin command setfil ,SEVEN_BIT ,3 ,sf$asc command setfil ,EIGHT-BIT ,3 ,sf$bin command setfil ,SEVEN-BIT ,3 ,sf$asc command setfil global .sbttl more set routines ; SET$DF set a default filename string for all file opens ; and creates. .enabl lsb set$df::copyz #argbuf ,#defdir,#filsiz; setup a default directory calls fparse ,<#200$,#filnam>; try to parse it to see if tst r0 ; if the string is valid beq 10$ ; ok message ; direrr r0 ; no, print the error out clrb defdir br 100$ 10$: message print #defdir message 100$: clr r0 return 200$: .asciz /JUNK.DAT/ .even global .dsabl lsb set$ho::clrb defdir message ,cr clr r0 return ; S E T $ L O ; ; SET LOGFILE filespec ; ; set and create the logfile set$lo::call sd$off ; insure previous file is closed calls create ,<#argbuf,#lun.lo,#text>; handle SET DEBUG FILE filename tst r0 ; did the logfile create work ? beq 10$ ; yes direrr r0 ; no,print the error out return 10$: bis #log$op ,trace ; yes, say it's open please copyz #argbuf ,#logfil,#30 ; save the debug filename for show message ; say we did it print #argbuf ; at last, confirm the logfile name message ; crlf return ; exit global .sbttl set send and set receive command setset ,END-OF-LINE,3 ,set$eo ,,octnum command setset ,PACKET-LENGTH,3,set$pl ,,decnum command setset ,PAUSE ,3 ,set$ps ,,decnum command setset ,TIMEOUT,3 ,set$ti ,,decnum command setset .sbttl set end-of-line octalvalue, set packetlength and set pause set$eo::calls octval ,<#argbuf> ; get the octal value now tst r0 ; did it work ? bne 100$ ; no movb r1 ,conpar+p.eol ; yes,stuff it in there please movb r1 ,setrec+p.eol ; yes,stuff it in there please 100$: return ; bye set$pl::calls l$val ,<#argbuf> ; set the arguement now tst r0 ; did it work ? bne 100$ ; no cmp r1 ,#20. ; minimum of twenty blo 110$ ; too small cmp r1 ,#94. ; max bhi 110$ ; too large movb r1 ,conpar+p.spsiz ; ok, stuff it in movb r1 ,setrec+p.spsiz ; ok, stuff it in movb r1 ,senpar+p.spsiz ; ok, stuff it in movb r1 ,setsen+p.spsiz ; ok, stuff it in 100$: return 110$: message ,cr return set$ps::calls l$val ,<#argbuf> ; get the value tst r0 ; well ? bne 100$ ; no, bad value mov r1 ,pauset ; ok 100$: return set$dl::calls l$val ,<#argbuf> ; get the value tst r0 ; well ? bne 100$ ; no, bad value mov r1 ,sendly ; ok 100$: return global .sbttl set escape whatever and set retry .enabl lsb set$es::calls octval ,<#argbuf> ; get the octal value now tst r0 ; did it work ? bne 100$ ; no cmpb r1 ,#40 ; must be a control character blo 10$ ; ok message ,cr br 20$ ; exit 10$: mov r1 ,conesc ; store it 20$: return set$re::calls l$val ,<#argbuf> ; SET RETRY decimal number tst r0 ; well ? bne 100$ ; no, bad value cmp r1 ,#3 ; a reasonable minimum ? bhis 30$ ; ok message ,cr return 30$: mov r1 ,maxtry ; ok 40$: return set$ti::calls l$val ,<#argbuf> ; SET TIMEOUT decimal number tst r0 ; well ? bne 100$ ; no, bad value cmp r1 ,#4 ; a reasonable minimum ? blo 50$ ; ok cmp r1 ,#60. ; a reasonable maximum ? blos 60$ ; yes 50$: message ,cr return 60$: movb r1 ,conpar+p.time ; alter remotes sinit default movb r1 ,setrec+p.time ; show thats it's been set 100$: return global .dsabl lsb .sbttl set record-format (highly RMS11 dependant) set$rf::calls getcm0 ,<#argbuf,#rfmlst>; find out which option was given tst r0 bmi 100$ jsr pc ,@r1 clr r0 100$: return srf$st: clr df$rat ; stream ascii please for RSTS? movb #fb$stm ,df$rfm ; say so and exit return srf$va: movb #fb$cr ,df$rat ; must have this for RSX? movb #fb$var ,df$rfm ; r.var and fd.cr return global command rfmlst ,STREAM ,3 ,srf$st command rfmlst ,VARIABLE,3 ,srf$va command rfmlst .sbttl enable or disable attribute packet transmission set$at::calls getcm0 ,<#argbuf,#attlst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now mov r0 ,sendat ; save for the show command 100$: clr r0 ; exit with no error set 110$: return cm$glob = 0 command attlst ,OFF ,3 ,sat$of command attlst ,ON ,2 ,sat$on command attlst ,NONE ,3 ,sat$of command attlst sat$of: clr r0 return sat$on: mov sp ,r0 return global set$pr::copyz #argbuf ,#prompt,#20. clr r0 return global .sbttl error debugging set$se::calls l$val ,<#argbuf> ; SET SEED decimal number tst r0 ; well ? bne 100$ ; no, bad value mov r1 ,testc ; save it 100$: return set$ra::calls getcm0 ,<#argbuf,#ranlst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now mov r0 ,ranerr ; save for the show command 100$: clr r0 ; exit with no error set 110$: return cm$glob = 0 command ranlst ,OFF ,3 ,sra$of command ranlst ,ON ,2 ,sra$on command ranlst ,NONE ,3 ,sra$of command ranlst sra$of: clr r0 return sra$on: mov sp ,r0 return global .sbttl disable xon/xoff flow control for RT11 ; SET RTFLOW ON ; SET RTFLOW OFF ; ; We need this because some modems (like the VADIC 212) can't ; handle XON's and XOFF's comming from the connect code. Thus ; we need a way to disable this. We need flow control for the ; connect command for RT11 due to the speed limitations of MT ; service. set$cf::calls getcm0 ,<#argbuf,#cflst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now mov r0 ,conflow ; save for the show command 100$: clr r0 ; exit with no error set 110$: return cm$glob = 0 command cflst ,OFF ,3 ,scf$of command cflst ,ON ,2 ,scf$on command cflst ,NONE ,3 ,scf$of command cflst scf$of: clr r0 return scf$on: mov sp ,r0 return .end