.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 calls getcm0 ,<#argbuf,#setcmd> tst r0 bmi 110$ calls getcm1 ,<#argbuf,#setcmd,r0> tst r0 bmi 110$ jsr pc ,@r1 tst r0 beq 100$ message ,cr 100$: return 110$: message ,cr return .dsabl lsb $cmglob = 0 command setcmd ,BLOCK-CHECK-TYPE,3,set$bl,,string command setcmd ,BLOCK_CHECK_TYPE,3,set$bl,,string command setcmd ,DEBUG ,3 ,set$de,,string command setcmd ,DEFAULT,3 ,set$df,,string command setcmd ,DELAY ,3 ,set$dl,,decnum command setcmd ,DIRECTORY,3 ,set$df,,string command setcmd ,DTR ,3 ,set$dt command setcmd ,END-OF-LINE,3 ,set$eo,,octnum command setcmd ,END_OF_LINE,3 ,set$eo,,octnum command setcmd ,ESCAPE ,3 ,set$es,,octnum command setcmd ,FILETYPE,3 ,set$fi,,string command setcmd ,FILE_TYPE,3 ,set$fi,,string command setcmd ,FILE-TYPE,3 ,set$fi,,string command setcmd ,HANGUP ,6 ,set$hu command setcmd ,HOME ,3 ,set$ho command setcmd ,LINE ,3 ,set$li,,string command setcmd ,LOGFILE,3 ,set$lo,,string command setcmd ,LOG_FILE,3 ,set$lo,,string command setcmd ,LOG-FILE,3 ,set$lo,,string command setcmd ,PACKET-LENGTH,3 ,set$pl,,decnum command setcmd ,PACKET_LENGTH,3 ,set$pl,,decnum command setcmd ,PARITY ,3 ,set$pa,,string command setcmd ,PAUSE ,3 ,set$ps,,decnum command setcmd ,RECORD-FORMAT,3 ,set$rf,,string command setcmd ,RECORD_FORMAT,3 ,set$rf,,string command setcmd ,RETRY ,3 ,set$re,,decnum command setcmd ,SPEED ,3 ,set$sp,,decnum command setcmd ,TIMEOUT,3 ,set$ti,,decnum command setcmd ,TIME-OUT,3 ,set$ti,,decnum command setcmd ,TIME_OUT,3 ,set$ti,,decnum command setcmd .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 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> ; 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 .dsabl lsb ttchk: tstb ttname ; insure a line is set beq 10$ ; ok clc return 10$: message ,cr sec return global .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 mov r0 ,parity ; save for the show command calls ttypar ,<#ttname,r0> ; set parity now 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 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 ,conpar+p.chkt movb #'1 ,setrec+p.chkt movb #'1 ,senpar+p.chkt movb #'1 ,setsen+p.chkt return sbl$2: movb #'2 ,conpar+p.chkt movb #'2 ,senpar+p.chkt movb #'2 ,setrec+p.chkt movb #'2 ,setsen+p.chkt return sbl$3: movb #'3 ,conpar+p.chkt movb #'3 ,setrec+p.chkt movb #'3 ,senpar+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 sf$bin: mov #binary ,image ; imagemode := true clr r0 ; no errors return ; bye 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 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 cm$glob = 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 ,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 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 bis #log$fi ,trace ; yes, set file opens and creates clr r0 100$: return sd$pak: call sdopen ; logfile open bcs 100$ ; no bis #log$pa ,trace ; yes, set packet logging on clr r0 100$: return sd$sta: call sdopen ; logfile open bcs 100$ ; no bis #log$st ,trace ; yes, set state logging on clr r0 100$: 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 < State transitions SET DEBUG STATE>,cr message message ,cr message ,cr message ,cr message return .sbttl more set routines ; SET$DF set a default filename string for all file opens ; and creates. .enabl lsb set$df: copyz #argbuf ,#defdir,#26 ; 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 .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 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 ,#4 ; a reasonable minimum ? bhis 30$ ; ok message 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 ,#5 ; a reasonable minimum ? blo 50$ ; ok cmp r1 ,#60. ; a reasonable maximum ? blos 60$ ; yes 50$: message 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 .end