Universal K20UNV - Kermit-20 Universal Symbols and Macros search monsym ; Wants things for NTINF% search macsym ; Needs FLD, MASK, Etc. search cmd ; Also cmd remark Can't do the .nobin; confuses COMPIL (I.E., the EXEC) ; .directive .nobin ; Doesn't need a .REL file ; Moved symbols and macros here from main module as part of 194 subttl Kermit program definitions pdlsiz==^d200 ; Stack size, be generous. takel==^d20 ;[78] TAKE command JFN stack size. ; N.B., Be careful about the aliases done here and Kermit's regular ; register usage. Also, be VERY aware that p5 aliases ac15, ; which macsym uses as the frame pointer for Bliss subroutine calls ; asubr's and transient variables. Stack vars and block. context ; are uneffected define cmdacs < ;;Have to clean up cmd accumulator polution if1 < ifdef p1, ;;CMD should be compiled seperately ifdef p2, ifdef p3, ifdef p4, ifdef p5, >;;if1 p1==q5 ;;p1 aliases q5 and state p2==p1+1 ;;p2 alias rchr p3==p2+1 ;;p3 alias schr p4==p3+1 ;;p4 alias debug p5==p4+1 ;;p5 alias FP!!! ifndef cx, ;;Occasional control linkage >;;cmdacs ; Don't let values confuse DDT (or me) f==0 ; AC definitions: flag AC (not used), t4==+1>+1>+1 ; temporary AC's, (Contiguous) q4==+1>+1>+1 ; and preserved AC's. (Contiguous) t5==q1 ;[186] Alias a temporary for double arithmatic state==q4+1 ; State of the automaton. q5==state ;[211] Can also CAREFULLY use ;[211] q5 aliases state AND p1 cmdacs ;;Clean up for our definitions rchr==state+1 ; Total file characters received. schr==rchr+1 ; Total file characters sent. debug==schr+1 ;[22] Debugging (0=none, 1=states, 2=packets) SOH==^o001 ; ASCII Start of header character. XON==^o021 ; XON is defined to be Control-Q (ASCII DC1). MAXBUF==^d10240 ; Packet buffer size [179] MAXPKT==^d94 ; Packet buffer size [179] IOBUF==^d9216 ; Communications i/o buffer [180] [216] (9K) ;[216] Enough for 9,000 character packet maxpkt=="~"-" "+2 ; Maximum size of a packet. dmxtry==5 ; Default number of retries on a packet. dimxtr==20 ; Default number of retries send initiate. drpsiz==^d80 ; Default receive packet size. dspsiz==^d80 ; Default send packet size. spmin==^d10 ;[47] Minimum size packet we want to send. spmax==^d9000 ;[47] Maximum ... dstim==^d<8*1000> ;[212] ms ; Default send time out interval. dstimf==8.0 ;[212] fl ; Same value as floating seconds drtim==^d<13*1000> ;[212] ms ;[128] Default receive time out interval. drtimf==13.0 ;[212] fl ; Same value as floating seconds dsrvtm==^d<30*1000> ;[212] ms ;[20] Def timout when awaiting server commands. dsrvtf==30.0 ;[212] fl ; Same value as floating seconds drpaus==0 ;[212] ms ;[36] Default pause before ACKing packets. drpauf==0.0 ;[212] fl ;[35] Default pause before ACKing packets. dspaus==0 ;[212] ms ;[36] Default pause before sending packets. dspauf==0.0 ;[212] fl ;[36] Default pause before sending packets. dspad==^o0 ; Default send padding char. drpad==^d0 ; Default receive padding char. drpadn==^d0 ; Default number of receive padding chars. dspadn==^d0 ; Default number of send padding chars. dpadmx==^d1024 ;[223] Maximum number of padding chars we'll do dseol==.chcrt ; Default send EOL char. dreol==.chcrt ; Default receive EOL char. dsquot=="#" ; Default outbound control prefix. drquot=="#" ; Default incoming control prefix. dqbin=="&" ; Default 8th-bit prefix. drept=="~" ; Default repeat count prefix. ddelay==^d5000 ;[212] ms ; Default delay before the first packet, msecs. ddelaf==5.0 ;[212] fl ;[194] Same as floating seconds (must give character) dxfull==0 ;[18] Full duplex. dxhalf==1 ;[18] Half duplex. defesc==34 ; Default CONNECT escape character is ^\. defits==-1 ;[75] Handle ITS binary files by default. defics==0 ;[160] Default case search for INPUT commands. defita==0 ;[160] Default timeout action for INPUTs. defito==^d<5*1000> ;[212] ms ;[160] Default timeout interval for INPUTs. defitf==5.0 ;[212] fl ;[194] Same value as floating point (as character) maxtim=^d<94*1000> ;[212] ms ;[2] Maximum timeout interval to set, secs. minlod=4.0 ;[2] Minimum ldav to consider for timeout. maxlod=50.0 ;[2] Maximum ldav to consider for timeout. blip=^d5 ;[4] Every this many packets, print a blip. subttl Definitions for Macro table remediation ; All part of 203. There are the beginnings of a macro editor, but ; for this release, development was stopped after the storage issues ; were fixed. ; ; The design of the macro editor is largely complete, but the ; implementation of SET commands that have third (and fourth) level ; selections is not. Briefly, everything parses, but to split things ; up, you have to handle the guide words, which may not be ; straightforward. ; ; The code is currently off. Define the symbol EDTMAC to cause it to ; be part of the executable. And understand that you will have some ; coding to do. ; ; EDTMAC==:1 ; Assemble (incomplete) macro editor define emacro (stuff) < ;;If have macro editor code ifdef EDTMAC, < 'stuff >> define nmacro (stuff) < ;;If DON'T have macro editor code ifndef EDTMAC, < 'stuff >> subttl FATAL Assembly errors ; Fatal assembly error macro. It would have been nice if MACRO had ; something like an .ERROR statement. Like ...MASM... define .fatal (message) < pass2 printx ?'message end >;;define .fatal SUBTTL Handy macros for address conversion ; Lifted from Extended Mode FTP Server rewrite REMARK Convert between 30 bit addresses and 21 bit page numbers pgshft==:^D9 ; Shift for page/address conversion define pg2adr (r,a) < ;; 21 bit page number ifb ,<.fatal No register specified> ifnb ,<.fatal 'a can only cast values in registers> ifg r-^o16,<.fatal register 'r is out of bounds> lsh r,pgshft ;; Convert page to address > define adr2pg (r,a) < ;; 30 bit address ifb ,<.fatal No register specified> ifnb ,<.fatal 'addr can only convert values in registers> ifg r-^o16,<.fatal Register 'r is out of bounds> lsh r,-pgshft ;; Convert address to page > REMARK Convert between 21 bit page numbers and 12 bit section numbers secsft==:^D9 ; Shift for section/page conversion define sec2pg (r,a) < ;; 12 bit section number ifb ,<.fatal No register specified> ifnb ,<.fatal 'a Can only cast values in registers> ifg r-^o16,<.fatal Register 'r is out of bounds> lsh r,secsft ;; Convert section to page > define pg2sec (r,a) < ;; 21 bit page number ifb ,<.fatal No register specified> ifnb ,<.fatal 'a Can only convert values in registers> ifg r-^o16,<.fatal Register 'r is out of bounds> lsh r,-secsft ;; Convert page to section > REMARK Convert between 30 bit addresses and 12 bit section numbers define sc2adr (r,a) < ;; 12 bit sction number ifb ,<.fatal No register specified> ifnb ,<.fatal 'a Can only cast values in registers> ifg r-^o16,<.fatal Register 'r is out of bounds> hrlz r,r ;; Convert section number to address > define adr2sc (r,a) < ;; 30 bit address ifb ,<.fatal No register specified> ifnb ,<.fatal 'a Can only convert values in registers> ifg r-^o16,<.fatal Register 'r is out of bounds> hlrz r,r ;; Convert address to section number > subttl Clean symbol artifacts up define cleans(s) < ;;Clean up symbols we won't need irp s,< ;;Do all this for each and every symbol ifdef s,< ;;Nothing to clean up if not defined .xcref s ;;Don't want symbol in cross reference .ifn s,macro,< ;;If not a macro, do some other clean up .noddt s ;;Don't need symbol in DDT suppress s ;;Don't want symbol in symbol table listing >;;.ifn if2 < purge s > ;;After second pass, don't need symbol >;;ifdef >;;irp >;;cleans subttl .PSECT switching ; Cuts down on typing because we aggressively use .PSECT's ; ; N.B., Does not nest like ifskp./else./endif. do. define chgsec(f,t) < ;;From and To .PSECT's .endps 'f ;;Get out of the From .PSECT .psect 't ;;Get into To .PSECT define retsec < ;;Define remote macro to put things back .endps 't ;;Done with To .PSECT .psect 'f ;;Get back into From .PSECT >;;retsec >;;chgsec subttl Parity Types (actually table offsets) .parno==0 ; None .parsp==1 ; Space, bit 8 is zero, always .parmk==2 ; Mark, bit 8 is one, always .parev==3 ; Even parity .parod==4 ; Odd parity subttl Various MACRO sizings ; The total macro table size is driven off the number of macros we can ; handle in the TBLUK% table and its associated string storage. We ; make some assumptions here that may or may not actually be true. ; These are, ; ; 1) A macro name (which is really 'only' a TBLUK% keyword) is ; rarely going over 10 characters (or two PDP-10 words) *AND* ; ; 2) Its expansion is rarely over 90 characters (or 18 words). ; ; If the numbers turn out to be wrong, they are easily changed. ; The MACROS .PSECT is then sized from the lengths calculated here. ; ; However, the number of macros was simply picked by what would fit ; in seven pages of memory. macmax==^d170 ;[203] ;[77] Maximum number of macros. mnblen==^d2*macmax ;[203] ;[77] Macro name buffer length in words (10 chars) mtblen==^d18*macmax ;[203] ;[77] Macro text buffer length in words (90 chars) macslp==0 ;[203] ; Initially no slop define adslop (n) < ;;[203] ; Add n to slop macslp==macslp+n ;;[203] ; Accumulate the extra words of slop .xcref macslp ;;[203] ; Still don't need this >;;adslop adslop(1) ;;[203] ; mactab TBLUK% header word adslop(1) ;;[203] ; mactbx end of mactab adslop(1) ;;[203] ; macbp adslop(1) ;;[203] ; ibmkey adslop(11) ;;[203] ; ibmmac (macro body) [octal] adslop(1) ;;[203] ; macx mactmp==macslp+macmax+mnblen+mtblen ;[203] Minimum length in words macpgs== ;[203] Minimum number of pages ifn , ;[203] Round up if not on a page boundar gcpgs==macpgs ;[203] Garbage collection is same size emacro < edpgs==macpgs > ;[203] As is the macro editing area maclen==macpgs*1000 ;[203] Now have length in words cleans() ;[203] Don't need temporary after second pass defbrk==3 ; Default number of breaks. maxnul==100 ; Maximum number of nulls. maxnam==^d40 ; Maximum characters in a system name syslen==<+1> ; Number of words in name block MXPKTW==<+1> ; Maximum packet size in words strblw==1000 ;[209] String buffer length in words strblc==1000*5 ;[209] Same value in characters ifl ,<.fatal Maximum password will exceed packet length> remark Various maximums for files and directories ; Assume following would only include the ;t attribute ; device:name.type.generation;attributes mxfilc==^d<6+1+1+39+1+39+1+39+1+6+1+1> ; Maximum Tops-20 file path in characters mxfilw==+1 ; Same thing in words dirmxc==^d<6+1+1+39+1+1> ; Maximum Tops-20 directory characters (+ .chnul) dirmxw==<+1> ; Same constant in words mxpwlc==^d39 ; Maximum size password Tops-20 will allow mxpwlw==^d<+1> ; Maximum storage required ; These MUST match CMDSTG, which does not declare the symbols ; so that MACRO can use them to allocate static storage, sigh... fdrmxc==<^d80*6> ; Foreign Directory Maximum size in characters fdrmxw==+1 ; Same size in words, plus slop fpwmxc==fdrmxc ; Foreign maximum password size in characters fpwmxw==fdrmxw ; Size size in words, plus slop ; Some characters that would be nice in MACSYM ... .chlpt==74 ; Left pointy bracket .chrpt==76 ; Right pointy bracket .chdbq==42 ; Double quote .chlpa==50 ; Left parenthesis .chrpa==51 ; Right parenthesis subttl Tops-20 Monitor Definitions and extensions ;[129] ARPA definitions (may not be in MONSYM) ifndef STAT%, ; So this will assemble ifndef TCP%NT, ; without symbols from BBN TCP monitor. ;TELNET negotiation options if not running a PANDA monitor iac==377 ; arpanet telnet IAC will==373 ; telnet will