.title k11st0 the SET command,overlay zero .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. .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 set$mo::strcpy #modem ,#argbuf call findmodem tst r0 bne 100$ mov #-1 ,r0 return 100$: clr r0 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::calls getcm0 ,<#argbuf,#parlst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now 20$: mov r0 ,parity ; save for the show command cmpb r0 ,#par$no ; no parity? beq 100$ ; yes, no problem message ,cr message ,cr message ,cr message ,cr 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 squote = 47 dquote = 42 ; 03-Aug-84 09:36:52 Allow literal characters like SET HAN '? set$ha::call ttchk ; insure a line is set bcs 100$ ; no, they must set line first mov #argbuf ,r0 ; get the address of argbuf cmpb @r0 ,#squote ; a literal quoted character? beq 10$ ; yes, use the next character as the cmpb @r0 ,#dquote ; handshake character. Look for " also bne 20$ ; no 10$: movb 1(r0) ,r0 ; get the handshake character please br 30$ ; and copy it please 20$: calls getcm0 , ; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now 30$: 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 .sbttl set DUPLEEX and SET LOCAL ; Provide both SET DUPLEX FULL/HALF and SET LOCAL ON/OFF ; to provide user's with compatibility with the different ; ways other Kermits do this. set$lc::mov #lcelst ,r5 br dulc set$du::mov #duplst ,r5 dulc: call ttchk ; insure a line is set bcs 100$ ; no, they must set line first 10$: calls getcm0 ,<#argbuf,r5> ; 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 ,2 ,sdu$fu command duplst ,HALF ,2 ,sdu$ha command duplst command lcelst ,ON ,2 ,sdu$ha command lcelst ,OFF ,2 ,sdu$fu command lcelst global .sbttl set ibm (may be site dependent) set$ib::calls getcm0 ,<#argbuf,#ibmlst>; 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 $cmglob = 0 command ibmlst ,ON ,2 ,sib$on command ibmlst ,OFF ,2 ,sib$of command ibmlst sib$on: mov sp ,duplex ; half duplex mov #par$ma ,parity ; mark parity movb #'Q&37 ,handch ; XON handshaking message ,cr return ; bye sib$of: clr duplex ; full duplex mov #par$no ,parity ; no parity clrb handch ; no handshaking message ,cr return .sbttl set update value set$nu::clr blip clr r0 return set$up::calls l$val ,<#argbuf> ; get the interval into decimal tst r0 ; ok ? bne 100$ ; no mov r1 ,blip ; yes, set it up please clr r0 return 100$: mov #1 ,r0 return .sbttl SET RSX set$rx::calls getcm0 ,<#argbuf,#rsxlst>; find out which option was given tst r0 ; did we find one bmi 110$ ; no jsr pc ,@r1 ; dispatch now 110$: return $cmglob = 0 command rsxlst ,CHARIO ,2 ,srx$ch command rsxlst ,LINEIO ,2 ,srx$li command rsxlst ,TC.DLU ,2 ,srx$tc command rsxlst ,CONNECT,2 ,srx$co command rsxlst srx$ch: mov sp ,chario clr r0 return srx$li: clr chario clr r0 return .enabl lsb srx$tc: mov #argbuf ,r0 ; attempt to resolve the tc.dlu 10$: tstb @r0 ; question for connecting to a beq 90$ ; modem. cmpb (r0)+ ,#40 ; scan for a trailing space bne 10$ ; not found yet 20$: movb @r0 ,r1 ; found space, next character must sub #'0 ,r1 ; be a digit from 0..2 bmi 90$ ; no good cmp r1 ,#2 ; check for upper limit now bhi 90$ ; no good mov r1 ,tcdlu ; save it clr r0 ; and exit br 100$ 90$: message ,cr mov #1 ,r0 100$: return .dsabl lsb .enabl lsb srx$co: call nextarg ; next one please 20$: cmpb @r1 ,#'D&137 ; SET RSX CONNECT DEFAULT bne 30$ ; no clr altcon ; yes, clear ALTCON then br 100$ 30$: cmpb @r1 ,#'A&137 ; SET RSX CONNECT ALTERNATE bne 90$ ; no mov sp ,altcon ; yes, flag it br 100$ 90$: message ,cr 100$: clr r0 return .dsabl lsb global .sbttl SET RT11 (10-Sep-85 13:11:38) ; SET RT11 FLOW_CONTROL ON ; SET RT11 FLOW_CONTROL OFF ; SET RT11 [NO]FLOW_CONTROL ; SET RT11 [NO]VOLUME_VERIFY ; SET RT11 CREATE_SIZE n set$rt::calls getcm0 ,<#argbuf,#rtlist> tst r0 bmi 110$ jsr pc ,@r1 110$: return srt$cr: call nextarg ; see if another arg present tstb @r1 ; well? beq 90$ ; no calls l$val , ; yes, see if a good number tst r0 ; well ? bne 90$ ; no mov r1 ,en$siz ; yes, save it please return ; exit 90$: message <%SET-W SET RT11 CREATE_SIZE decimal_value>,cr return srt$fl: call nextarg ; get third argument in command tstb @r1 ; did we find one or stop on null beq 90$ ; null, assume SET RT11 FLOW_CONTROL cmpb (r1)+ ,#'O&137 ; must be 'O' next bne 110$ ; not 'O', error clr r0 ; assume no flow control cmpb (r1)+ ,#'F&137 ; 'F' --> SET RT11 FLOW OFF beq 100$ ; ok 90$: mov sp ,r0 ; not off, assume ON 100$: mov r0 ,rtflow ; store the value and exit clr r0 return 110$: message <%SET-W SET RT11 FLOW [ON][OFF]>,cr mov #1 ,r0 return srt$vo: mov sp ,rtvol clr r0 return srt$nv: clr rtvol clr r0 return srt$nf: clr rtflow clr r0 return cm$glob = 0 command rtlist ,FLOW_CONTROL ,2 ,srt$fl command rtlist ,NOFLOW_CONTROL ,2 ,srt$nf command rtlist ,NOVOLUME_VERIFY,3 ,srt$nv command rtlist ,VOLUME_VERIFY ,3 ,srt$vo command rtlist ,CREATE_SIZE ,2 ,srt$cr command rtlist global .sbttl disable xon/xoff flow control for RT11 (old command) ; 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 nextarg:mov #argbuf ,r1 10$: tstb @r1 beq 100$ cmpb (r1)+ ,#40 bne 10$ 100$: return .end