home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / pdp10 / k10unv.mac < prev    next >
Text File  |  2020-01-01  |  22KB  |  661 lines

  1.     UNIVER    KERUNV - Universal for KERMIT-10
  2.     SUBTTL    Robert C. McQueen/NB
  3.     REMARK    Version 1 - Antonino N. J. Mione/NB/RCM
  4.  
  5.   ; Universals
  6.  
  7.     SEARCH    GLXMAC            ; Parser interface definitions
  8.  
  9.   ; Version number
  10.  
  11.     KERVER==3            ; Major version number
  12.     KERMIN==0            ; Minor version number
  13.     KEREDT==136            ; Edit level
  14.     KERWHO==0            ; Customer edit
  15.  
  16.   ; Prologue
  17.  
  18.     PROLOG    (KERUNV)        ; Interface to GLXMAC correctly
  19.     SUBTTL    Table of Contents
  20.  
  21. ;+
  22. ;.pag.lit
  23. ;                          Table of Contents of KERUNV
  24. ;
  25. ;
  26. ;                                    Section                             Page
  27. ;   1.   Table of Contents. . . . . . . . . . . . . . . . . . . . . . . .   2
  28. ;   2.   Revision History . . . . . . . . . . . . . . . . . . . . . . . .   3
  29. ;   3.   Definitions
  30. ;      3.1.   Default . . . . . . . . . . . . . . . . . . . . . . . . . .   4
  31. ;      3.2.   Operating system
  32. ;         3.2.1.   TOPS-10
  33. ;            3.2.1.1.   Channels. . . . . . . . . . . . . . . . . . . . .   4
  34. ;            3.2.1.2.   Terminal info . . . . . . . . . . . . . . . . . .   5
  35. ;      3.3.   Macro blocks. . . . . . . . . . . . . . . . . . . . . . . .   6
  36. ;   4.   .FD block extensions . . . . . . . . . . . . . . . . . . . . . .   7
  37. ;   5.   LOKWLD routine calling sequence. . . . . . . . . . . . . . . . .   8
  38. ;   6.   Definitions
  39. ;      6.1.   BLISS-36 interface symbols. . . . . . . . . . . . . . . . .   9
  40. ;      6.2.   Symbols
  41. ;         6.2.1.   File types (byte size) . . . . . . . . . . . . . . . .  10
  42. ;      6.3.   Macro
  43. ;         6.3.1.   BLSRTN - Define a BLISS called routine . . . . . . . .  11
  44. ;         6.3.2.   BLSRET - Return a value to BLISS . . . . . . . . . . .  12
  45. ;         6.3.3.   BLSCAL - Call a BLISS-36 routine . . . . . . . . . . .  13
  46. ;         6.3.4.   KERRORS - Things passed to BLISS . . . . . . . . . . .  14
  47. ;         6.3.5.   $KERR - Issue error messages . . . . . . . . . . . . .  15
  48. ;         6.3.6.   KERERR - Issue an error to the remote. . . . . . . . .  16
  49. ;         6.3.7.   Character masks. . . . . . . . . . . . . . . . . . . .  17
  50. ;   7.   End of KERUNV. . . . . . . . . . . . . . . . . . . . . . . . . .  18
  51. ;
  52. ;.end lit.pag
  53. ;-
  54.     SUBTTL    Revision History
  55.  
  56. COMMENT    |
  57.  
  58. Start of version 2(100)
  59.  
  60. 100    By: Robert C. McQueen        On: Yes.
  61.     Lots of rewritting and other things.
  62.  
  63. 101    By: Nick Bush            On: 22-August-1983
  64.     Fix setting up of seven or eight bit byte pointers for file
  65.     I/O.  Do this once when the file is opened, not each time
  66.     a buffer is read.  TOPS-10 is quite happy to use whatever
  67.     byte size is stored in the buffer header byte pointer, and will
  68.     use that size to determine the byte count.
  69.  
  70. 102    By: Robert C. McQueen        On: 29-August-1983
  71.     Remove the TT% routines and use the common TT_ routines in the
  72.     Bliss module KERTT.
  73.  
  74. 103    By: Robert C. McQueen        On: 16-September-1983
  75.     Add XFR%STATUS and baud rate stats.
  76.  
  77. 104    By: Robert C. McQueen & Nick Bush    On: Many days
  78.     - Add CRC support
  79.     - Redo the SHOW command processing
  80.     - Fix random bugs.
  81.  
  82. 105    By: Robert C. McQueen & Nick Bush    On: Many days
  83.     - Implement IBM mode
  84.     - Implement file disposition
  85.     - Make CCL entry work
  86.  
  87. 106    By: Nick Bush        On: 3-November-1983
  88.     Fix terminal handling for non-network systems.  Also make sure
  89.     the terminal will be available when we try to use it by grabing
  90.     it when we set the line.
  91.     Modules: KERMIT
  92.  
  93. 107    By: Nick Bush        On: 12-November-1983
  94.     Add macro definition capability for SET options.
  95.     Modules: KERMIT
  96.  
  97. 110    By: Robert C. McQueen        On: 16-November-1983
  98.     Fix message number checks so that they all would be mod 64.
  99.     Modules: KERUNV
  100.  
  101. 111    By: Nick Bush        On: 16-November-1983
  102.     Add TAKE command.
  103.     Modules: KERMIT
  104.  
  105. 112    By: Nick Bush        On: 17-November-1983
  106.     Clear the input buffer before we send a message.  This ignores any garbage
  107.     which came in on the line since the last message we received.
  108.     Modules: KERMIT
  109.  
  110. 113    By: Nick Bush        On: 14-December-1983
  111.     Add some more single character commands for use during transfers.
  112.     Control-A will type a status line, control-D will toggle debugging, and
  113.     carriage return will force a timeout (therefore either a NAK or
  114.  retransmission).
  115.     Modules: KERMIT
  116.  
  117. 114    By: Nick Bush        On: 19-December-1983
  118.     Default the transfer terminal to KERMIT: if the logical name exists and
  119.     is a terminal.
  120.  
  121.     Remove FILE%DUMP, since KERMSG no longer references it.
  122.     Modules: KERMIT
  123.  
  124. 115    By: Nick Bush        On: 5-January-1983
  125.     Add support for different types of file names.  This changes the
  126.     SET FILE-xxx commands to be SET FILE xxx and adds a SET FILE NAMING
  127.     command.
  128.     Modules: KERMIT
  129.  
  130. 116    By: Nick Bush        On: 14-March-1984
  131.     Add parsing for all REMOTE commands.
  132.     Add support for some generic and local commands.
  133.     Fix wild card processing to handle pathological names correctly.
  134.     Modules: KERMIT,KERSYS,KERWLD
  135.  
  136. 117    By: Nick Bush        On: 14-March-1984
  137.     Add code to support changing default path.
  138.     Modules: KERSYS
  139.  
  140. 120    By: Robert C. McQueen        On: 28-March-1984
  141.     Add bug fixes from WMU.  Many thanks to the people out in Kalamazoo.
  142.     Modules: KERMIT,KERWLD
  143.  
  144. 121    By: Robert C. McQueen        On: 28-March-1984
  145.     Add SET PROMPT command.  Start adding support for generic COPY and
  146.     RENAME commands.
  147.     Modules: KERUNV,KERMIT,KERWLD
  148.  
  149. 122    By: Robert C. McQueen        On: 29-March-1984
  150.     Remove ADJBP instructions and add the five instructions that adjust byte
  151.     pointers for the KI10s that use Kermit.'
  152.     Modules: KERMIT
  153.  
  154. 123    By: Nick Bush        On: 2-April-1984
  155.     Change SPACE generic command to use PPN of default path instead of users
  156.     PPN if no argument is supplied.
  157.     Make DIRECTORY and DELETE generic commands print out a header at the
  158.     top of the list, and print file size in both words and allocated blocks.
  159.     Add SPACE as synonym for DISK-USAGE command and ERASE as synonym for
  160.     DELETE.
  161.  
  162.     Modules: KERMIT,KERSYS
  163.  
  164. 124    By: Robert C. McQueen        On: 8-May-1984
  165.     Fix KERMIT-10's handling of remote directories
  166.     Modules: KERWLD
  167.  
  168. Start of Version 3(124)
  169.  
  170. 125    By: Nick Bush        On: 26-June-1984
  171.     Add patches from CSM:
  172.  
  173.     - Wrong AC when setting PIM break set.
  174.     - Checks for not-logged-in Kermits
  175.     - Parity for CONNECT (implemented differently)
  176.  
  177.     Modules: KERMIT,KERSYS
  178.  
  179. 126    By: Nick Bush        On: 11-July-1984
  180.     RECEIVE FOO.BAR would not work correctly.  It thought the extension was
  181.     wild-carded.
  182.  
  183.     Modules: KERMIT
  184.  
  185. 127    By: David Stevens    On: 10-July-1985
  186.     Add in symbols required to implement XON-XOFF-processing.
  187.  
  188.     Modules: KERMIT, KERUNV
  189.  
  190. 130    By: David Stevens    On: 15-July-1985
  191.     Fix problem of prompt in multiple file sends.
  192.     - note this change caused a change in all versions of KERMIT
  193.       using KERMSG.
  194.  
  195.     Modules: KERMIT, KERMSG
  196.  
  197. 131    By: David Stevens    On: 25-July-1985
  198.     Add in SET HANDSHAKE to kermit
  199.  
  200.     Modules: KERMIT
  201.  
  202. 132    By: David Stevens    On: 29-July-1985
  203.     Fix DFNMAC - IBM to set the handshake character instead of the
  204.     IBM-MODE
  205.  
  206.     Modules: KERMIT
  207.  
  208. 133    By: David Stevens    On: 29-July-1985
  209.     Eliminate SET IBM-MODE
  210.  
  211.     Modules: KERMIT,KERGLB
  212.  
  213. 134    By: Dan Norstedt    On: 19-June-1989
  214.     Added Extended Packets
  215.  
  216.     Modules: KERMIT,KERGLB,KERMSG,KERUNV
  217.  
  218. 135     By Nick Bush                    On: 1-April-2006
  219.     Kludge implemented by OCTERM to reset terminal status for GLXLIB
  220.     appears to no longer be necessary.  Until we can determine
  221.     which version of GLXLIB fixed it, just treat the routine as a
  222.     noop.
  223.  
  224. 136     By Nick Bush            On: 17-April-2006
  225.     Try better fix for OCTERM - get bits for K%OPEN and just call
  226.     that routine.  Previous fix left <ESC> echoing as "$".
  227.     Also fix CAXE in T$CONN to have double brackets
  228.     to avoid problem with the macro.
  229. |
  230.     SUBTTL    Definitions -- Default
  231.  
  232. ; The following are assembly parameters for KERMIT
  233. ND    FTKLKS,    0            ; Don't assume KL or KS processor
  234.  
  235. ND    PDLLEN,    4000            ; Stack size
  236. TOPS10<
  237. ND    D$MSFD,    ^D5            ; Max number of SFDs
  238. ND    D$BLKS,    ^D128            ; Number of words to read in directory
  239. >; End of TOPS10 conditional
  240. ND    D$PSIZ,    ^D5            ; Max prompt size in words including null
  241. ND    D$ESCAP,.CHCNY            ;[125] Use control-Y  for escape character
  242. ND    D$MAXD,    ^D128            ;[107] May have up to 128 macros
  243.  
  244.  
  245.     SUBTTL    Definitions -- Operating system -- TOPS-10 -- Channels
  246.  
  247. ; The following are the various definitions for the TOPS-10 version of
  248. ; Kermit-10.
  249.  
  250. TOPS10<
  251.     FIL==    1            ; File channel
  252.     TTY==    2            ; Kludge channel
  253.     TTYHLD==3            ; Channel to hold onto terminal with
  254. >; End of TOPS10 conditional
  255.  
  256.  
  257.     SUBTTL    DEFINITIONS -- XON-XOFF Processing
  258.  
  259. ; Symbols for XON/XOFF processing
  260.  
  261.     $XXDEF==    0        ;[127] Default
  262.     $XXLCL==    1        ;[127] Local mode
  263.     $XXREM==    2        ;[127] Remote mode
  264.  
  265.     SUBTTL    Definitions -- Operating system -- TOPS-10 -- Terminal info
  266.  
  267. ; The following are the terminal information blocks.  These blocks are used
  268. ; to process the various information for a terminal.
  269.  
  270. ;; !=========================================================================!
  271. ;; !                   ANF node the terminal is connect to                   !
  272. ;; !-------------------------------------------------------------------------!
  273. ;; !                        Line number on that node                         !
  274. ;; !-------------------------------------------------------------------------!
  275. ;; !                           Sixbit device name                            !
  276. ;; !-------------------------------------------------------------------------!
  277. ;; !                             Channel number                              !
  278. ;; !-------------------------------------------------------------------------!
  279. ;; !                              Terminal UDX                               !
  280. ;; !-------------------------------------------------------------------------!
  281. ;; !                       I/O status on failing UUOs                        !
  282. ;; !-------------------------------------------------------------------------!
  283. ;; !                             Buffer address                              !
  284. ;; !-------------------------------------------------------------------------!
  285. ;; !                          Buffer size in words                           !
  286. ;; !-------------------------------------------------------------------------!
  287. ;; \                                                                         \
  288. ;; \                           Input buffer header                           \
  289. ;; \                                                                         \
  290. ;; !-------------------------------------------------------------------------!
  291. ;; \                                                                         \
  292. ;; \                          Output buffer header                           \
  293. ;; \                                                                         \
  294. ;; !=========================================================================!
  295.  
  296. TOPS10<
  297.     $TTNOD==0            ; ANF node the terminal is connected to
  298.     $TTLIN==1            ; Line number on that node
  299.     $TTDEV==2            ; Device name
  300.     $TTCHN==3            ; Terminal channel
  301.     $TTUDX==4            ; Terminal UDX
  302.     $TTIOS==5            ; Status from failing UUO
  303.     $TTBAD==6            ; Address of the buffers
  304.     $TTBSZ==7            ; Size of the buffers
  305.     $TTIBH==10            ; Input buffer header offset
  306.     $TTOBH==13            ; Output buffer header
  307.     $TTPAG==16            ; Status of TTY PAGE when terminal opened
  308.     $TTSIZ==17            ; Size of the block
  309. >; End of TOPS10 definitions
  310.     SUBTTL    Definitions -- Macro blocks
  311.  
  312. ;[107] The following is the format used to store the SET macros.
  313. ;
  314. ;; !=========================================================================!
  315. ;; !       Address of this block        ! Address of action routine (SETMAC) !
  316. ;; !-------------------------------------------------------------------------!
  317. ;; !      Offset to expansion text      !       Length of entire block       !
  318. ;; !=========================================================================!
  319. ;; \                                                                         \
  320. ;; \                           Macro name in ASCIZ                           \
  321. ;; \                                                                         \
  322. ;; !=========================================================================!
  323. ;; \                                                                         \
  324. ;; \                        Macro expansion in ASCIZ                         \
  325. ;; \                                                                         \
  326. ;; !=========================================================================!
  327. ;
  328.     $MBRTN==0            ; Address of routine
  329.     $MBOFS==1            ; Address of offset to text
  330.         MB$OFS==LHMASK        ; Offset is in left half
  331.     $MBLEN==1            ; Offset to length
  332.         MB$LEN==RHMASK        ; In right halfword
  333.     $MBNAM==2            ; Offset to name text
  334.     SUBTTL    .FD block extensions
  335.  
  336. ; The .FD block extensions are to allow the handling of wild card processing
  337. ; in this module.
  338.  
  339. ; Additional words
  340.  
  341. TOPS10<
  342.     .FDNMM==FDXSIZ            ; Name mask
  343.     .FDEXM==.FDNMM+1        ; Extension mask
  344.     .FDDIM==.FDEXM+1        ; Offset to the directory mask
  345.     .FDSFM==.FDDIM+1        ; First SFD mask
  346.     .FDMOD==.FDSFM+5        ; Mod word
  347.     .FDMOM==.FDMOD+1        ; Mask word for the mod word
  348.     .FDSIZ==.FDMOM+1        ; Size of the block
  349.  
  350. ; Offsets
  351.  
  352.     .FDD2M==.FDDIM-.FDPPN        ; Define offset from one to another
  353.  
  354. ; Flag bits in .FXMOD
  355.  
  356.     FD.DIR==1B0            ; Directory given
  357.     FD.DFX==1B1            ; Use default directory
  358. >; End of TOPS10 conditional
  359.     SUBTTL    LG block definitions
  360.  
  361. ; The following defines the block for the log file definitions
  362.  
  363.     $LGFLG==0            ; Flags
  364.         LG$SET==1B18        ; Log file name set
  365.         LG$APP==1B19        ; Append to file
  366.         LG$OPN==1B20        ; File is open
  367.     $LGIFN==$LGFLG+1        ; IFN for open file
  368.     $LGFOB==$LGIFN+1        ; FOB for log file
  369.     $LGFD==    $LGFOB+FOB.MZ        ; Offset for FD
  370.     $LGSIZ==$LGFD+FDXSIZ        ; Length of block
  371.     SUBTTL    LOKWLD routine calling sequence
  372.  
  373. ; The following is the argument block that is used to call the TOPS-10 wild
  374. ; card processing routine.  The FILOP block that is passed is required to have
  375. ; the LEB address store in it and the PTH block stored in the LEB.
  376.  
  377. ;; !=========================================================================!
  378. ;; !                            .FD block addrss                             !
  379. ;; !-------------------------------------------------------------------------!
  380. ;; !       Length of FILOP. block       !      Address of FILOP. block       !
  381. ;; !-------------------------------------------------------------------------!
  382. ;; !                                  Flags                                  !
  383. ;; !=========================================================================!
  384.  
  385. ; Argument block offsets
  386.  
  387. TOPS10<
  388. $LKFDB==0                ; Offset to the .FD block
  389. $LKFLP==1                ; Filop. block information
  390.  LK$FLN==LHMASK                ; Length  of the FILOP. block
  391.  LK$FLP==RHMASK                ; Address of the FILOP. block
  392. $LKFLG==2                ; Flags
  393.  LK$FRS==1B0                ; First time being called
  394.  LK$SFD==1B1                ; Return SFDs to the caller, otherwise
  395.                     ;  they are suppressed
  396. $LKLEN==3                ; Length of the block
  397. >; End of TOPS10 conditional
  398.     SUBTTL    Definitions -- BLISS-36 interface symbols
  399.  
  400. ; The following symbols are required to interface with BLISS-36 KERMSG.
  401.  
  402.     BLSTRU==    1        ; Bliss value of true
  403.     BLSFAL==    0        ; Bliss value of false
  404.     SUBTTL    Definitions -- Symbols -- File types (byte size)
  405.  
  406. ; The following are the allowed bytes sizes or types
  407.  
  408. DEFINE $FLTYP<
  409.     FT    S7,<7-bit>
  410.     FT    S8,<8-bit>
  411.     FT    S36,<36-bit>        ;;[127] 36 bit mode
  412.     FT    AUT,<Auto>
  413. >; End of $FLTYP macro definition
  414.  
  415. DEFINE FT(NAM,TEXT)<
  416.     $FB'NAM==..
  417.     ..==..+1
  418. >; End of FT macro definition
  419.  
  420.     $FBSMIN==0            ; Min value
  421.     ..==0                ; Initialize the value
  422.     $FLTYP                ; Expand the values
  423.     $FBSMAX==3            ;[127] Max value
  424.  
  425. ND    D$FTP,    $FBAUT            ; Use auto as default
  426.     SUBTTL    Definitions -- Macro -- ADJSP - Adjust stack pointer
  427.  
  428. ; This macro is only defined for running on KI or KA processors.
  429. ;It will generate the correct code from fixing a stack pointer.
  430.  
  431. IFE FTKLKS,<
  432.     DEFINE    ADJSP(AC,VALUE)
  433. <IFGE VALUE,ADD AC,[XWD VALUE,VALUE]
  434.  IFL  VALUE,SUB AC,[XWD -VALUE,-VALUE]
  435. > ; End of DEFINE ADJSP
  436. > ; End of IFE FTKLKS
  437.     SUBTTL    Definitions -- Macro -- BLSRTN - Define a BLISS called routine
  438.  
  439. ; BLSRTN - This macro will define a routine that is called by BLISS-36.  It
  440. ;    will define the offsets to the arguments on the stack.
  441. ;
  442. ; Usage:
  443. ;
  444. ;    BLSRTN    (Routine,<Arguments>)
  445. ;
  446.  
  447. DEFINE    BLSRTN(ROUTINE,ARGUMENTS)<
  448. ROUTINE::
  449.     PUSH    P,.FP        ;; Save the frame pointer
  450.     PUSH    P,[[POP    P,.FP        ;; Restore 16
  451.         POPJ    P,]]        ;; Return to the caller
  452.     XMOVEI    .FP,-2(P)    ;; Point to the arguments
  453. IFNB <ARGUMENTS><
  454.     .XCREF            ;; Turn off cross reference
  455.     ..==1            ;; First argument is -1 on the stack
  456.     IRP <ARGUMENTS><
  457.         .BLSRT(ARGUMENTS,\..) ;; Define the argument
  458.         ..==..+1    ;; Count back
  459.     >;; End of IRP <ARGUMENTS>
  460.     .CREF            ;; Turn CREF information back on
  461. >;; End of IFNB <ARGUMENTS>
  462. >; End of BLSRTN macro definition
  463.  
  464. DEFINE    .BLSRT(ITEM,OFFSET)<DEFINE ITEM<-^O'OFFSET'(.FP)>>
  465.     SUBTTL    Definitions -- Macro -- BLSRET - Return a value to BLISS
  466.  
  467. ; BLSRET - This macro will return a value to the BLISS-36 routine.  It will
  468. ;    store the value to return in register 1.
  469.  
  470. DEFINE    BLSRET(ARGUMENT),<
  471.     JRST    [MOVX    S1,ARGUMENT        ;; Get the value to return
  472.         $RET]                ;; Return to the caller
  473. >; End of BLSRET macro definition
  474.     SUBTTL    Definitions -- Macro -- BLSCAL - Call a BLISS-36 routine
  475.  
  476. ;+
  477. ;.hl1 BLSCAL
  478. ;This routine is used to call a BLISS-36 routine.  It will cause the arguments
  479. ;that are given to be pushed on the stack and then the routine to be called.
  480. ;When the routine returns it will remove the items from the stack.
  481. ;.literal
  482. ;
  483. ; Usage:
  484. ;    BLSCAL    (PARITY,S1)
  485. ;
  486. ;.END LITERAL
  487. ;-
  488.  
  489. DEFINE    BLSCAL(ROUTINE,ARGS)<
  490.     .XCREF                ;; Turn off CREF Processing
  491.     .CNT.==0            ;; Initialize the count
  492.     .XCREF    .CNT.            ;; Don't cref this either
  493.     .CREF                ;; Turn the CREF stuff back on
  494. IFNB <ARGS><
  495.     IRP <ARGS><
  496.     PUSH    P,ARGS            ;; Put an item on the stack
  497.     .CNT.==.CNT.+1            ;; Increment the count
  498.     >;; End of IRP
  499. >;; IFNB <ARGS>
  500.     PUSHJ    P,ROUTINE        ;; Call the BLISS routine
  501. IFN .CNT.,<
  502.     ADJSP    P,-.CNT.        ;; Remove the items from the stack
  503. >;; End of IFN .CNT.
  504. >; End of BLSCAL macro definition
  505.     SUBTTL    Definitions -- Macro -- KERRORS - Things passed to BLISS
  506.  
  507. ;+
  508. ;.HL1 KERRORS
  509. ;The following are the items that are passed back to the BLISS-36 routines.
  510. ;-
  511.  
  512. DEFINE    KERRORS<
  513. KER NORMAL,013,<Normal return>
  514. KER INTERNALERR,022,<Internal error>
  515. KER LINTOOLNG,102,<Command line too long>
  516. KER EOF,113,<End of file reached>
  517. KER RMS32,122,<!AS for !AS>
  518. KER NOMORFILES,133,<No more files>
  519. KER ILLFILTYP,142,<Illegal file type>
  520. KER REC%TOO%BIG,152,<Record to big for KERMIT's internal buffers>
  521. KER ERRMSG,162,<Received an E (error) packet>
  522. KER CHKSUMERR,172,<Checksum error>
  523. KER SNDERR,202,<Send failure>
  524. KER RETRIES,212,<Too many retries>
  525. KER EXIT,223,<Server requested exit>
  526. KER UNIMPLGEN,232,<Unimplemented generic command>
  527. KER UNISRV,242,<Unimplemented server command>
  528. KER PROTOERR,252,<Protocol error>
  529. KER ZEROLENMSG,262,<Zero length message>
  530. KER LINTERM,272,<Line specified is not a terminal>
  531. KER TIMEOUT,300,<Timed out waiting to receive/send packet>
  532. KER ABORTED,312,<Transfer aborted by user interrupt>
  533. KER RECERR,322,<Receive error - !AS>
  534. >; End of KERRORS macro definition
  535.  
  536. DEFINE    KER(TYPE,VALUE,TEXT)<TYPE=VALUE>
  537.     KERRORS
  538.     SUBTTL    Definitions -- Macro -- $KERR - Issue error messages
  539.  
  540. ;+
  541. ;.hl1 $KERR
  542. ;This macro will cause an error message to be issued.
  543. ;-
  544.  
  545. DEFINE    $KERR(Message)<
  546. TOPS10<
  547.     $TEXT    (,<?Kermit-10 Message>)
  548. >; End of TOPS10 conditional
  549. TOPS20<
  550.     $TEXT    (,<?Kermit-20 Message>)
  551. >; End of TOPS20 conditional
  552. >; End of $KERR macro definition
  553.     SUBTTL    Definitions -- Macro -- KERERR - Issue an error to the remote
  554.  
  555. ;+
  556. ;.hl1 KERERR
  557. ;This macro is used to issue an error message to the remote KERMIT.
  558. ;.LITERAL
  559. ;
  560. ; Usage:
  561. ;    KERERR    (<Text>)
  562. ;    (Return here)
  563. ;
  564. ;.end literal
  565. ;-
  566.  
  567. DEFINE    KERERR(TEXT)<
  568.     GLOB    <.KERERR>
  569.     $CALL    .KERERR
  570.     JUMP    [ITEXT(TEXT)]
  571. >; End of KERERR macro definition
  572.     SUBTTL    Definitions -- Macro -- Character masks
  573.  
  574. ;+
  575. ;.hl1 Character mask macros
  576. ; The following set of macros will define a four word bit map, with
  577. ;each bit corresponding to a single ascii character.  Only the first
  578. ;32 bits of each word are used.  This is compatible with the corresponding
  579. ;macro in MACSYM, the usage of character masks in TOPS-20 JSYS's, and
  580. ;the usage in TECO.
  581. ;
  582. ;.hl2 BRINI$
  583. ; This macro will initialize the masks.
  584. ;.literal
  585. ;
  586. ; Usage:
  587. ;    BRINI$(NAME)
  588. ;
  589. ; Where: NAME is the name to be used for building the mask. It should not
  590. ;     be more than 3 characters, as it is used to generate symbol names.
  591. ;
  592. ;.end literal
  593. ;-
  594.  
  595. DEFINE BRINI$(NAME,INIT),<
  596.     IFNB <INIT>,<
  597.         %.0'NAME==%.0'INIT ;; Copy the initial values (if any)
  598.         %.1'NAME==%.1'INIT
  599.         %.2'NAME==%.2'INIT
  600.         %.3'NAME==%.3'INIT
  601.     > ;; End of IFNB <INIT>
  602.     IFB <INIT>,<
  603.         %.0'NAME==<%.1'NAME==0> ;; If no initial value, use 0
  604.         %.2'NAME==<%.3'NAME==0>
  605.     > ;; End of IFB <INIT>
  606. > ; End of DEFINE BRINI$
  607.  
  608. ;; Now define the macros for adding an removing characters
  609.  
  610. DEFINE BRKCH$(NAME,FIRST,LAST)<
  611.     $$$VAL==FIRST
  612.     $$$VL1==FIRST
  613.     IFNB <LAST>,<$$$VL1==LAST>
  614.     .XCREF $$$VAL,$$$VL1
  615.     BRK$$$(NAME,$$$VAL,$$$VL1,!)
  616.     SUPPRESS $$$VAL,$$$VL1
  617. > ;; End of BRKCH$
  618.  
  619. DEFINE UNBRK$(NAME,FIRST,LAST)<
  620.     $$$VAL==FIRST
  621.     $$$VL1==FIRST
  622.     IFNB <LAST>,<$$$VL1==LAST>
  623.     .XCREF $$$VAL,$$$VL1
  624.     BRK$$$(NAME,$$$VAL,$$$VL1,&^-)
  625.     SUPPRESS $$$VAL,$$$VL1
  626. > ;; End of UNBRK$
  627.  
  628.  
  629.  
  630. DEFINE BRK$$$(NAME,FIRST,LAST,OP)<
  631.     $$$FST==FIRST        ;; Get initial value
  632.     $$$LST==LAST        ;; Get final value
  633.     .XCREF $$$FST,$$$LST
  634.     REPEAT $$$LST-$$$FST+1,<
  635.         $$$WRD==$$$FST/^D32    ;; Determine which word gets this char
  636.         $$$BIT==$$$FST-<$$$WRD*^D32> ;; And determine the bit
  637.         IFE $$$WRD-4,<        ;; Special 'char' for TECO?
  638.             $$$WRD==3    ;; Yes, put in 3rd word
  639.             $$$BIT==$$$BIT+^D32 ;; After 32'nd bit
  640.         > ;; End of IFE $$$WRD-4
  641.         BR$$$$(NAME,\"<$$$WRD+"0">,$$$BIT,OP)
  642.         $$$FST==$$$FST+1
  643.     > ;; End of REPEAT
  644. > ; End of BRK$$$
  645.  
  646. DEFINE BR$$$$(NAME,WORD,BIT,OP)<%.'WORD'NAME==%.'WORD'NAME'OP'1B<BIT>>
  647.  
  648.  
  649. DEFINE BRGEN$(NAME)<EXP %.0'NAME,%.1'NAME,%.2'NAME,%.3'NAME>
  650.  
  651. DEFINE BRWRD$(NAME,INDEX),<%.'INDEX'NAME>
  652.  
  653.  
  654. ; Now generate some common masks
  655.  
  656.     BRINI$(ALL)            ; All characters
  657.     BRKCH$(ALL,0,177)        ;  .  .  .
  658.     SUBTTL    End of KERUNV
  659.  
  660.     END