UNIVER KERUNV - Universal for KERMIT-10 SUBTTL Robert C. McQueen/NB REMARK Version 1 - Antonino N. J. Mione/NB/RCM ; Universals SEARCH GLXMAC ; Parser interface definitions ; Version number KERVER==3 ; Major version number KERMIN==0 ; Minor version number KEREDT==136 ; Edit level KERWHO==0 ; Customer edit ; Prologue PROLOG (KERUNV) ; Interface to GLXMAC correctly SUBTTL Table of Contents ;+ ;.pag.lit ; Table of Contents of KERUNV ; ; ; Section Page ; 1. Table of Contents. . . . . . . . . . . . . . . . . . . . . . . . 2 ; 2. Revision History . . . . . . . . . . . . . . . . . . . . . . . . 3 ; 3. Definitions ; 3.1. Default . . . . . . . . . . . . . . . . . . . . . . . . . . 4 ; 3.2. Operating system ; 3.2.1. TOPS-10 ; 3.2.1.1. Channels. . . . . . . . . . . . . . . . . . . . . 4 ; 3.2.1.2. Terminal info . . . . . . . . . . . . . . . . . . 5 ; 3.3. Macro blocks. . . . . . . . . . . . . . . . . . . . . . . . 6 ; 4. .FD block extensions . . . . . . . . . . . . . . . . . . . . . . 7 ; 5. LOKWLD routine calling sequence. . . . . . . . . . . . . . . . . 8 ; 6. Definitions ; 6.1. BLISS-36 interface symbols. . . . . . . . . . . . . . . . . 9 ; 6.2. Symbols ; 6.2.1. File types (byte size) . . . . . . . . . . . . . . . . 10 ; 6.3. Macro ; 6.3.1. BLSRTN - Define a BLISS called routine . . . . . . . . 11 ; 6.3.2. BLSRET - Return a value to BLISS . . . . . . . . . . . 12 ; 6.3.3. BLSCAL - Call a BLISS-36 routine . . . . . . . . . . . 13 ; 6.3.4. KERRORS - Things passed to BLISS . . . . . . . . . . . 14 ; 6.3.5. $KERR - Issue error messages . . . . . . . . . . . . . 15 ; 6.3.6. KERERR - Issue an error to the remote. . . . . . . . . 16 ; 6.3.7. Character masks. . . . . . . . . . . . . . . . . . . . 17 ; 7. End of KERUNV. . . . . . . . . . . . . . . . . . . . . . . . . . 18 ; ;.end lit.pag ;- SUBTTL Revision History COMMENT | Start of version 2(100) 100 By: Robert C. McQueen On: Yes. Lots of rewritting and other things. 101 By: Nick Bush On: 22-August-1983 Fix setting up of seven or eight bit byte pointers for file I/O. Do this once when the file is opened, not each time a buffer is read. TOPS-10 is quite happy to use whatever byte size is stored in the buffer header byte pointer, and will use that size to determine the byte count. 102 By: Robert C. McQueen On: 29-August-1983 Remove the TT% routines and use the common TT_ routines in the Bliss module KERTT. 103 By: Robert C. McQueen On: 16-September-1983 Add XFR%STATUS and baud rate stats. 104 By: Robert C. McQueen & Nick Bush On: Many days - Add CRC support - Redo the SHOW command processing - Fix random bugs. 105 By: Robert C. McQueen & Nick Bush On: Many days - Implement IBM mode - Implement file disposition - Make CCL entry work 106 By: Nick Bush On: 3-November-1983 Fix terminal handling for non-network systems. Also make sure the terminal will be available when we try to use it by grabing it when we set the line. Modules: KERMIT 107 By: Nick Bush On: 12-November-1983 Add macro definition capability for SET options. Modules: KERMIT 110 By: Robert C. McQueen On: 16-November-1983 Fix message number checks so that they all would be mod 64. Modules: KERUNV 111 By: Nick Bush On: 16-November-1983 Add TAKE command. Modules: KERMIT 112 By: Nick Bush On: 17-November-1983 Clear the input buffer before we send a message. This ignores any garbage which came in on the line since the last message we received. Modules: KERMIT 113 By: Nick Bush On: 14-December-1983 Add some more single character commands for use during transfers. Control-A will type a status line, control-D will toggle debugging, and carriage return will force a timeout (therefore either a NAK or retransmission). Modules: KERMIT 114 By: Nick Bush On: 19-December-1983 Default the transfer terminal to KERMIT: if the logical name exists and is a terminal. Remove FILE%DUMP, since KERMSG no longer references it. Modules: KERMIT 115 By: Nick Bush On: 5-January-1983 Add support for different types of file names. This changes the SET FILE-xxx commands to be SET FILE xxx and adds a SET FILE NAMING command. Modules: KERMIT 116 By: Nick Bush On: 14-March-1984 Add parsing for all REMOTE commands. Add support for some generic and local commands. Fix wild card processing to handle pathological names correctly. Modules: KERMIT,KERSYS,KERWLD 117 By: Nick Bush On: 14-March-1984 Add code to support changing default path. Modules: KERSYS 120 By: Robert C. McQueen On: 28-March-1984 Add bug fixes from WMU. Many thanks to the people out in Kalamazoo. Modules: KERMIT,KERWLD 121 By: Robert C. McQueen On: 28-March-1984 Add SET PROMPT command. Start adding support for generic COPY and RENAME commands. Modules: KERUNV,KERMIT,KERWLD 122 By: Robert C. McQueen On: 29-March-1984 Remove ADJBP instructions and add the five instructions that adjust byte pointers for the KI10s that use Kermit.' Modules: KERMIT 123 By: Nick Bush On: 2-April-1984 Change SPACE generic command to use PPN of default path instead of users PPN if no argument is supplied. Make DIRECTORY and DELETE generic commands print out a header at the top of the list, and print file size in both words and allocated blocks. Add SPACE as synonym for DISK-USAGE command and ERASE as synonym for DELETE. Modules: KERMIT,KERSYS 124 By: Robert C. McQueen On: 8-May-1984 Fix KERMIT-10's handling of remote directories Modules: KERWLD Start of Version 3(124) 125 By: Nick Bush On: 26-June-1984 Add patches from CSM: - Wrong AC when setting PIM break set. - Checks for not-logged-in Kermits - Parity for CONNECT (implemented differently) Modules: KERMIT,KERSYS 126 By: Nick Bush On: 11-July-1984 RECEIVE FOO.BAR would not work correctly. It thought the extension was wild-carded. Modules: KERMIT 127 By: David Stevens On: 10-July-1985 Add in symbols required to implement XON-XOFF-processing. Modules: KERMIT, KERUNV 130 By: David Stevens On: 15-July-1985 Fix problem of prompt in multiple file sends. - note this change caused a change in all versions of KERMIT using KERMSG. Modules: KERMIT, KERMSG 131 By: David Stevens On: 25-July-1985 Add in SET HANDSHAKE to kermit Modules: KERMIT 132 By: David Stevens On: 29-July-1985 Fix DFNMAC - IBM to set the handshake character instead of the IBM-MODE Modules: KERMIT 133 By: David Stevens On: 29-July-1985 Eliminate SET IBM-MODE Modules: KERMIT,KERGLB 134 By: Dan Norstedt On: 19-June-1989 Added Extended Packets Modules: KERMIT,KERGLB,KERMSG,KERUNV 135 By Nick Bush On: 1-April-2006 Kludge implemented by OCTERM to reset terminal status for GLXLIB appears to no longer be necessary. Until we can determine which version of GLXLIB fixed it, just treat the routine as a noop. 136 By Nick Bush On: 17-April-2006 Try better fix for OCTERM - get bits for K%OPEN and just call that routine. Previous fix left echoing as "$". Also fix CAXE in T$CONN to have double brackets to avoid problem with the macro. | SUBTTL Definitions -- Default ; The following are assembly parameters for KERMIT ND FTKLKS, 0 ; Don't assume KL or KS processor ND PDLLEN, 4000 ; Stack size TOPS10< ND D$MSFD, ^D5 ; Max number of SFDs ND D$BLKS, ^D128 ; Number of words to read in directory >; End of TOPS10 conditional ND D$PSIZ, ^D5 ; Max prompt size in words including null ND D$ESCAP,.CHCNY ;[125] Use control-Y for escape character ND D$MAXD, ^D128 ;[107] May have up to 128 macros SUBTTL Definitions -- Operating system -- TOPS-10 -- Channels ; The following are the various definitions for the TOPS-10 version of ; Kermit-10. TOPS10< FIL== 1 ; File channel TTY== 2 ; Kludge channel TTYHLD==3 ; Channel to hold onto terminal with >; End of TOPS10 conditional SUBTTL DEFINITIONS -- XON-XOFF Processing ; Symbols for XON/XOFF processing $XXDEF== 0 ;[127] Default $XXLCL== 1 ;[127] Local mode $XXREM== 2 ;[127] Remote mode SUBTTL Definitions -- Operating system -- TOPS-10 -- Terminal info ; The following are the terminal information blocks. These blocks are used ; to process the various information for a terminal. ;; !=========================================================================! ;; ! ANF node the terminal is connect to ! ;; !-------------------------------------------------------------------------! ;; ! Line number on that node ! ;; !-------------------------------------------------------------------------! ;; ! Sixbit device name ! ;; !-------------------------------------------------------------------------! ;; ! Channel number ! ;; !-------------------------------------------------------------------------! ;; ! Terminal UDX ! ;; !-------------------------------------------------------------------------! ;; ! I/O status on failing UUOs ! ;; !-------------------------------------------------------------------------! ;; ! Buffer address ! ;; !-------------------------------------------------------------------------! ;; ! Buffer size in words ! ;; !-------------------------------------------------------------------------! ;; \ \ ;; \ Input buffer header \ ;; \ \ ;; !-------------------------------------------------------------------------! ;; \ \ ;; \ Output buffer header \ ;; \ \ ;; !=========================================================================! TOPS10< $TTNOD==0 ; ANF node the terminal is connected to $TTLIN==1 ; Line number on that node $TTDEV==2 ; Device name $TTCHN==3 ; Terminal channel $TTUDX==4 ; Terminal UDX $TTIOS==5 ; Status from failing UUO $TTBAD==6 ; Address of the buffers $TTBSZ==7 ; Size of the buffers $TTIBH==10 ; Input buffer header offset $TTOBH==13 ; Output buffer header $TTPAG==16 ; Status of TTY PAGE when terminal opened $TTSIZ==17 ; Size of the block >; End of TOPS10 definitions SUBTTL Definitions -- Macro blocks ;[107] The following is the format used to store the SET macros. ; ;; !=========================================================================! ;; ! Address of this block ! Address of action routine (SETMAC) ! ;; !-------------------------------------------------------------------------! ;; ! Offset to expansion text ! Length of entire block ! ;; !=========================================================================! ;; \ \ ;; \ Macro name in ASCIZ \ ;; \ \ ;; !=========================================================================! ;; \ \ ;; \ Macro expansion in ASCIZ \ ;; \ \ ;; !=========================================================================! ; $MBRTN==0 ; Address of routine $MBOFS==1 ; Address of offset to text MB$OFS==LHMASK ; Offset is in left half $MBLEN==1 ; Offset to length MB$LEN==RHMASK ; In right halfword $MBNAM==2 ; Offset to name text SUBTTL .FD block extensions ; The .FD block extensions are to allow the handling of wild card processing ; in this module. ; Additional words TOPS10< .FDNMM==FDXSIZ ; Name mask .FDEXM==.FDNMM+1 ; Extension mask .FDDIM==.FDEXM+1 ; Offset to the directory mask .FDSFM==.FDDIM+1 ; First SFD mask .FDMOD==.FDSFM+5 ; Mod word .FDMOM==.FDMOD+1 ; Mask word for the mod word .FDSIZ==.FDMOM+1 ; Size of the block ; Offsets .FDD2M==.FDDIM-.FDPPN ; Define offset from one to another ; Flag bits in .FXMOD FD.DIR==1B0 ; Directory given FD.DFX==1B1 ; Use default directory >; End of TOPS10 conditional SUBTTL LG block definitions ; The following defines the block for the log file definitions $LGFLG==0 ; Flags LG$SET==1B18 ; Log file name set LG$APP==1B19 ; Append to file LG$OPN==1B20 ; File is open $LGIFN==$LGFLG+1 ; IFN for open file $LGFOB==$LGIFN+1 ; FOB for log file $LGFD== $LGFOB+FOB.MZ ; Offset for FD $LGSIZ==$LGFD+FDXSIZ ; Length of block SUBTTL LOKWLD routine calling sequence ; The following is the argument block that is used to call the TOPS-10 wild ; card processing routine. The FILOP block that is passed is required to have ; the LEB address store in it and the PTH block stored in the LEB. ;; !=========================================================================! ;; ! .FD block addrss ! ;; !-------------------------------------------------------------------------! ;; ! Length of FILOP. block ! Address of FILOP. block ! ;; !-------------------------------------------------------------------------! ;; ! Flags ! ;; !=========================================================================! ; Argument block offsets TOPS10< $LKFDB==0 ; Offset to the .FD block $LKFLP==1 ; Filop. block information LK$FLN==LHMASK ; Length of the FILOP. block LK$FLP==RHMASK ; Address of the FILOP. block $LKFLG==2 ; Flags LK$FRS==1B0 ; First time being called LK$SFD==1B1 ; Return SFDs to the caller, otherwise ; they are suppressed $LKLEN==3 ; Length of the block >; End of TOPS10 conditional SUBTTL Definitions -- BLISS-36 interface symbols ; The following symbols are required to interface with BLISS-36 KERMSG. BLSTRU== 1 ; Bliss value of true BLSFAL== 0 ; Bliss value of false SUBTTL Definitions -- Symbols -- File types (byte size) ; The following are the allowed bytes sizes or types DEFINE $FLTYP< FT S7,<7-bit> FT S8,<8-bit> FT S36,<36-bit> ;;[127] 36 bit mode FT AUT, >; End of $FLTYP macro definition DEFINE FT(NAM,TEXT)< $FB'NAM==.. ..==..+1 >; End of FT macro definition $FBSMIN==0 ; Min value ..==0 ; Initialize the value $FLTYP ; Expand the values $FBSMAX==3 ;[127] Max value ND D$FTP, $FBAUT ; Use auto as default SUBTTL Definitions -- Macro -- ADJSP - Adjust stack pointer ; This macro is only defined for running on KI or KA processors. ;It will generate the correct code from fixing a stack pointer. IFE FTKLKS,< DEFINE ADJSP(AC,VALUE) ; End of DEFINE ADJSP > ; End of IFE FTKLKS SUBTTL Definitions -- Macro -- BLSRTN - Define a BLISS called routine ; BLSRTN - This macro will define a routine that is called by BLISS-36. It ; will define the offsets to the arguments on the stack. ; ; Usage: ; ; BLSRTN (Routine,) ; DEFINE BLSRTN(ROUTINE,ARGUMENTS)< ROUTINE:: PUSH P,.FP ;; Save the frame pointer PUSH P,[[POP P,.FP ;; Restore 16 POPJ P,]] ;; Return to the caller XMOVEI .FP,-2(P) ;; Point to the arguments IFNB < .XCREF ;; Turn off cross reference ..==1 ;; First argument is -1 on the stack IRP < .BLSRT(ARGUMENTS,\..) ;; Define the argument ..==..+1 ;; Count back >;; End of IRP .CREF ;; Turn CREF information back on >;; End of IFNB >; End of BLSRTN macro definition DEFINE .BLSRT(ITEM,OFFSET)> SUBTTL Definitions -- Macro -- BLSRET - Return a value to BLISS ; BLSRET - This macro will return a value to the BLISS-36 routine. It will ; store the value to return in register 1. DEFINE BLSRET(ARGUMENT),< JRST [MOVX S1,ARGUMENT ;; Get the value to return $RET] ;; Return to the caller >; End of BLSRET macro definition SUBTTL Definitions -- Macro -- BLSCAL - Call a BLISS-36 routine ;+ ;.hl1 BLSCAL ;This routine is used to call a BLISS-36 routine. It will cause the arguments ;that are given to be pushed on the stack and then the routine to be called. ;When the routine returns it will remove the items from the stack. ;.literal ; ; Usage: ; BLSCAL (PARITY,S1) ; ;.END LITERAL ;- DEFINE BLSCAL(ROUTINE,ARGS)< .XCREF ;; Turn off CREF Processing .CNT.==0 ;; Initialize the count .XCREF .CNT. ;; Don't cref this either .CREF ;; Turn the CREF stuff back on IFNB < IRP < PUSH P,ARGS ;; Put an item on the stack .CNT.==.CNT.+1 ;; Increment the count >;; End of IRP >;; IFNB PUSHJ P,ROUTINE ;; Call the BLISS routine IFN .CNT.,< ADJSP P,-.CNT. ;; Remove the items from the stack >;; End of IFN .CNT. >; End of BLSCAL macro definition SUBTTL Definitions -- Macro -- KERRORS - Things passed to BLISS ;+ ;.HL1 KERRORS ;The following are the items that are passed back to the BLISS-36 routines. ;- DEFINE KERRORS< KER NORMAL,013, KER INTERNALERR,022, KER LINTOOLNG,102, KER EOF,113, KER RMS32,122, KER NOMORFILES,133, KER ILLFILTYP,142, KER REC%TOO%BIG,152, KER ERRMSG,162, KER CHKSUMERR,172, KER SNDERR,202, KER RETRIES,212, KER EXIT,223, KER UNIMPLGEN,232, KER UNISRV,242, KER PROTOERR,252, KER ZEROLENMSG,262, KER LINTERM,272, KER TIMEOUT,300, KER ABORTED,312, KER RECERR,322, >; End of KERRORS macro definition DEFINE KER(TYPE,VALUE,TEXT) KERRORS SUBTTL Definitions -- Macro -- $KERR - Issue error messages ;+ ;.hl1 $KERR ;This macro will cause an error message to be issued. ;- DEFINE $KERR(Message)< TOPS10< $TEXT (,) >; End of TOPS10 conditional TOPS20< $TEXT (,) >; End of TOPS20 conditional >; End of $KERR macro definition SUBTTL Definitions -- Macro -- KERERR - Issue an error to the remote ;+ ;.hl1 KERERR ;This macro is used to issue an error message to the remote KERMIT. ;.LITERAL ; ; Usage: ; KERERR () ; (Return here) ; ;.end literal ;- DEFINE KERERR(TEXT)< GLOB <.KERERR> $CALL .KERERR JUMP [ITEXT(TEXT)] >; End of KERERR macro definition SUBTTL Definitions -- Macro -- Character masks ;+ ;.hl1 Character mask macros ; The following set of macros will define a four word bit map, with ;each bit corresponding to a single ascii character. Only the first ;32 bits of each word are used. This is compatible with the corresponding ;macro in MACSYM, the usage of character masks in TOPS-20 JSYS's, and ;the usage in TECO. ; ;.hl2 BRINI$ ; This macro will initialize the masks. ;.literal ; ; Usage: ; BRINI$(NAME) ; ; Where: NAME is the name to be used for building the mask. It should not ; be more than 3 characters, as it is used to generate symbol names. ; ;.end literal ;- DEFINE BRINI$(NAME,INIT),< IFNB ,< %.0'NAME==%.0'INIT ;; Copy the initial values (if any) %.1'NAME==%.1'INIT %.2'NAME==%.2'INIT %.3'NAME==%.3'INIT > ;; End of IFNB IFB ,< %.0'NAME==<%.1'NAME==0> ;; If no initial value, use 0 %.2'NAME==<%.3'NAME==0> > ;; End of IFB > ; End of DEFINE BRINI$ ;; Now define the macros for adding an removing characters DEFINE BRKCH$(NAME,FIRST,LAST)< $$$VAL==FIRST $$$VL1==FIRST IFNB ,<$$$VL1==LAST> .XCREF $$$VAL,$$$VL1 BRK$$$(NAME,$$$VAL,$$$VL1,!) SUPPRESS $$$VAL,$$$VL1 > ;; End of BRKCH$ DEFINE UNBRK$(NAME,FIRST,LAST)< $$$VAL==FIRST $$$VL1==FIRST IFNB ,<$$$VL1==LAST> .XCREF $$$VAL,$$$VL1 BRK$$$(NAME,$$$VAL,$$$VL1,&^-) SUPPRESS $$$VAL,$$$VL1 > ;; End of UNBRK$ DEFINE BRK$$$(NAME,FIRST,LAST,OP)< $$$FST==FIRST ;; Get initial value $$$LST==LAST ;; Get final value .XCREF $$$FST,$$$LST REPEAT $$$LST-$$$FST+1,< $$$WRD==$$$FST/^D32 ;; Determine which word gets this char $$$BIT==$$$FST-<$$$WRD*^D32> ;; And determine the bit IFE $$$WRD-4,< ;; Special 'char' for TECO? $$$WRD==3 ;; Yes, put in 3rd word $$$BIT==$$$BIT+^D32 ;; After 32'nd bit > ;; End of IFE $$$WRD-4 BR$$$$(NAME,\"<$$$WRD+"0">,$$$BIT,OP) $$$FST==$$$FST+1 > ;; End of REPEAT > ; End of BRK$$$ DEFINE BR$$$$(NAME,WORD,BIT,OP)<%.'WORD'NAME==%.'WORD'NAME'OP'1B> DEFINE BRGEN$(NAME) DEFINE BRWRD$(NAME,INDEX),<%.'INDEX'NAME> ; Now generate some common masks BRINI$(ALL) ; All characters BRKCH$(ALL,0,177) ; . . . SUBTTL End of KERUNV END