home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / old / misc / pdp10 / k10unv.mac < prev    next >
Text File  |  2020-01-01  |  21KB  |  649 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==134            ; 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.     SUBTTL    Definitions -- Default
  219.  
  220. ; The following are assembly parameters for KERMIT
  221. ND    FTKLKS,    0            ; Don't assume KL or KS processor
  222.  
  223. ND    PDLLEN,    4000            ; Stack size
  224. TOPS10<
  225. ND    D$MSFD,    ^D5            ; Max number of SFDs
  226. ND    D$BLKS,    ^D128            ; Number of words to read in directory
  227. >; End of TOPS10 conditional
  228. ND    D$PSIZ,    ^D5            ; Max prompt size in words including null
  229. ND    D$ESCAP,.CHCNY            ;[125] Use control-Y  for escape character
  230. ND    D$MAXD,    ^D128            ;[107] May have up to 128 macros
  231.  
  232.  
  233.     SUBTTL    Definitions -- Operating system -- TOPS-10 -- Channels
  234.  
  235. ; The following are the various definitions for the TOPS-10 version of
  236. ; Kermit-10.
  237.  
  238. TOPS10<
  239.     FIL==    1            ; File channel
  240.     TTY==    2            ; Kludge channel
  241.     TTYHLD==3            ; Channel to hold onto terminal with
  242. >; End of TOPS10 conditional
  243.  
  244.  
  245.     SUBTTL    DEFINITIONS -- XON-XOFF Processing
  246.  
  247. ; Symbols for XON/XOFF processing
  248.  
  249.     $XXDEF==    0        ;[127] Default
  250.     $XXLCL==    1        ;[127] Local mode
  251.     $XXREM==    2        ;[127] Remote mode
  252.  
  253.     SUBTTL    Definitions -- Operating system -- TOPS-10 -- Terminal info
  254.  
  255. ; The following are the terminal information blocks.  These blocks are used
  256. ; to process the various information for a terminal.
  257.  
  258. ;; !=========================================================================!
  259. ;; !                   ANF node the terminal is connect to                   !
  260. ;; !-------------------------------------------------------------------------!
  261. ;; !                        Line number on that node                         !
  262. ;; !-------------------------------------------------------------------------!
  263. ;; !                           Sixbit device name                            !
  264. ;; !-------------------------------------------------------------------------!
  265. ;; !                             Channel number                              !
  266. ;; !-------------------------------------------------------------------------!
  267. ;; !                              Terminal UDX                               !
  268. ;; !-------------------------------------------------------------------------!
  269. ;; !                       I/O status on failing UUOs                        !
  270. ;; !-------------------------------------------------------------------------!
  271. ;; !                             Buffer address                              !
  272. ;; !-------------------------------------------------------------------------!
  273. ;; !                          Buffer size in words                           !
  274. ;; !-------------------------------------------------------------------------!
  275. ;; \                                                                         \
  276. ;; \                           Input buffer header                           \
  277. ;; \                                                                         \
  278. ;; !-------------------------------------------------------------------------!
  279. ;; \                                                                         \
  280. ;; \                          Output buffer header                           \
  281. ;; \                                                                         \
  282. ;; !=========================================================================!
  283.  
  284. TOPS10<
  285.     $TTNOD==0            ; ANF node the terminal is connected to
  286.     $TTLIN==1            ; Line number on that node
  287.     $TTDEV==2            ; Device name
  288.     $TTCHN==3            ; Terminal channel
  289.     $TTUDX==4            ; Terminal UDX
  290.     $TTIOS==5            ; Status from failing UUO
  291.     $TTBAD==6            ; Address of the buffers
  292.     $TTBSZ==7            ; Size of the buffers
  293.     $TTIBH==10            ; Input buffer header offset
  294.     $TTOBH==13            ; Output buffer header
  295.     $TTPAG==16            ; Status of TTY PAGE when terminal opened
  296.     $TTSIZ==17            ; Size of the block
  297. >; End of TOPS10 definitions
  298.     SUBTTL    Definitions -- Macro blocks
  299.  
  300. ;[107] The following is the format used to store the SET macros.
  301. ;
  302. ;; !=========================================================================!
  303. ;; !       Address of this block        ! Address of action routine (SETMAC) !
  304. ;; !-------------------------------------------------------------------------!
  305. ;; !      Offset to expansion text      !       Length of entire block       !
  306. ;; !=========================================================================!
  307. ;; \                                                                         \
  308. ;; \                           Macro name in ASCIZ                           \
  309. ;; \                                                                         \
  310. ;; !=========================================================================!
  311. ;; \                                                                         \
  312. ;; \                        Macro expansion in ASCIZ                         \
  313. ;; \                                                                         \
  314. ;; !=========================================================================!
  315. ;
  316.     $MBRTN==0            ; Address of routine
  317.     $MBOFS==1            ; Address of offset to text
  318.         MB$OFS==LHMASK        ; Offset is in left half
  319.     $MBLEN==1            ; Offset to length
  320.         MB$LEN==RHMASK        ; In right halfword
  321.     $MBNAM==2            ; Offset to name text
  322.     SUBTTL    .FD block extensions
  323.  
  324. ; The .FD block extensions are to allow the handling of wild card processing
  325. ; in this module.
  326.  
  327. ; Additional words
  328.  
  329. TOPS10<
  330.     .FDNMM==FDXSIZ            ; Name mask
  331.     .FDEXM==.FDNMM+1        ; Extension mask
  332.     .FDDIM==.FDEXM+1        ; Offset to the directory mask
  333.     .FDSFM==.FDDIM+1        ; First SFD mask
  334.     .FDMOD==.FDSFM+5        ; Mod word
  335.     .FDMOM==.FDMOD+1        ; Mask word for the mod word
  336.     .FDSIZ==.FDMOM+1        ; Size of the block
  337.  
  338. ; Offsets
  339.  
  340.     .FDD2M==.FDDIM-.FDPPN        ; Define offset from one to another
  341.  
  342. ; Flag bits in .FXMOD
  343.  
  344.     FD.DIR==1B0            ; Directory given
  345.     FD.DFX==1B1            ; Use default directory
  346. >; End of TOPS10 conditional
  347.     SUBTTL    LG block definitions
  348.  
  349. ; The following defines the block for the log file definitions
  350.  
  351.     $LGFLG==0            ; Flags
  352.         LG$SET==1B18        ; Log file name set
  353.         LG$APP==1B19        ; Append to file
  354.         LG$OPN==1B20        ; File is open
  355.     $LGIFN==$LGFLG+1        ; IFN for open file
  356.     $LGFOB==$LGIFN+1        ; FOB for log file
  357.     $LGFD==    $LGFOB+FOB.MZ        ; Offset for FD
  358.     $LGSIZ==$LGFD+FDXSIZ        ; Length of block
  359.     SUBTTL    LOKWLD routine calling sequence
  360.  
  361. ; The following is the argument block that is used to call the TOPS-10 wild
  362. ; card processing routine.  The FILOP block that is passed is required to have
  363. ; the LEB address store in it and the PTH block stored in the LEB.
  364.  
  365. ;; !=========================================================================!
  366. ;; !                            .FD block addrss                             !
  367. ;; !-------------------------------------------------------------------------!
  368. ;; !       Length of FILOP. block       !      Address of FILOP. block       !
  369. ;; !-------------------------------------------------------------------------!
  370. ;; !                                  Flags                                  !
  371. ;; !=========================================================================!
  372.  
  373. ; Argument block offsets
  374.  
  375. TOPS10<
  376. $LKFDB==0                ; Offset to the .FD block
  377. $LKFLP==1                ; Filop. block information
  378.  LK$FLN==LHMASK                ; Length  of the FILOP. block
  379.  LK$FLP==RHMASK                ; Address of the FILOP. block
  380. $LKFLG==2                ; Flags
  381.  LK$FRS==1B0                ; First time being called
  382.  LK$SFD==1B1                ; Return SFDs to the caller, otherwise
  383.                     ;  they are suppressed
  384. $LKLEN==3                ; Length of the block
  385. >; End of TOPS10 conditional
  386.     SUBTTL    Definitions -- BLISS-36 interface symbols
  387.  
  388. ; The following symbols are required to interface with BLISS-36 KERMSG.
  389.  
  390.     BLSTRU==    1        ; Bliss value of true
  391.     BLSFAL==    0        ; Bliss value of false
  392.     SUBTTL    Definitions -- Symbols -- File types (byte size)
  393.  
  394. ; The following are the allowed bytes sizes or types
  395.  
  396. DEFINE $FLTYP<
  397.     FT    S7,<7-bit>
  398.     FT    S8,<8-bit>
  399.     FT    S36,<36-bit>        ;;[127] 36 bit mode
  400.     FT    AUT,<Auto>
  401. >; End of $FLTYP macro definition
  402.  
  403. DEFINE FT(NAM,TEXT)<
  404.     $FB'NAM==..
  405.     ..==..+1
  406. >; End of FT macro definition
  407.  
  408.     $FBSMIN==0            ; Min value
  409.     ..==0                ; Initialize the value
  410.     $FLTYP                ; Expand the values
  411.     $FBSMAX==3            ;[127] Max value
  412.  
  413. ND    D$FTP,    $FBAUT            ; Use auto as default
  414.     SUBTTL    Definitions -- Macro -- ADJSP - Adjust stack pointer
  415.  
  416. ; This macro is only defined for running on KI or KA processors.
  417. ;It will generate the correct code from fixing a stack pointer.
  418.  
  419. IFE FTKLKS,<
  420.     DEFINE    ADJSP(AC,VALUE)
  421. <IFGE VALUE,ADD AC,[XWD VALUE,VALUE]
  422.  IFL  VALUE,SUB AC,[XWD -VALUE,-VALUE]
  423. > ; End of DEFINE ADJSP
  424. > ; End of IFE FTKLKS
  425.     SUBTTL    Definitions -- Macro -- BLSRTN - Define a BLISS called routine
  426.  
  427. ; BLSRTN - This macro will define a routine that is called by BLISS-36.  It
  428. ;    will define the offsets to the arguments on the stack.
  429. ;
  430. ; Usage:
  431. ;
  432. ;    BLSRTN    (Routine,<Arguments>)
  433. ;
  434.  
  435. DEFINE    BLSRTN(ROUTINE,ARGUMENTS)<
  436. ROUTINE::
  437.     PUSH    P,.FP        ;; Save the frame pointer
  438.     PUSH    P,[[POP    P,.FP        ;; Restore 16
  439.         POPJ    P,]]        ;; Return to the caller
  440.     XMOVEI    .FP,-2(P)    ;; Point to the arguments
  441. IFNB <ARGUMENTS><
  442.     .XCREF            ;; Turn off cross reference
  443.     ..==1            ;; First argument is -1 on the stack
  444.     IRP <ARGUMENTS><
  445.         .BLSRT(ARGUMENTS,\..) ;; Define the argument
  446.         ..==..+1    ;; Count back
  447.     >;; End of IRP <ARGUMENTS>
  448.     .CREF            ;; Turn CREF information back on
  449. >;; End of IFNB <ARGUMENTS>
  450. >; End of BLSRTN macro definition
  451.  
  452. DEFINE    .BLSRT(ITEM,OFFSET)<DEFINE ITEM<-^O'OFFSET'(.FP)>>
  453.     SUBTTL    Definitions -- Macro -- BLSRET - Return a value to BLISS
  454.  
  455. ; BLSRET - This macro will return a value to the BLISS-36 routine.  It will
  456. ;    store the value to return in register 1.
  457.  
  458. DEFINE    BLSRET(ARGUMENT),<
  459.     JRST    [MOVX    S1,ARGUMENT        ;; Get the value to return
  460.         $RET]                ;; Return to the caller
  461. >; End of BLSRET macro definition
  462.     SUBTTL    Definitions -- Macro -- BLSCAL - Call a BLISS-36 routine
  463.  
  464. ;+
  465. ;.hl1 BLSCAL
  466. ;This routine is used to call a BLISS-36 routine.  It will cause the arguments
  467. ;that are given to be pushed on the stack and then the routine to be called.
  468. ;When the routine returns it will remove the items from the stack.
  469. ;.literal
  470. ;
  471. ; Usage:
  472. ;    BLSCAL    (PARITY,S1)
  473. ;
  474. ;.END LITERAL
  475. ;-
  476.  
  477. DEFINE    BLSCAL(ROUTINE,ARGS)<
  478.     .XCREF                ;; Turn off CREF Processing
  479.     .CNT.==0            ;; Initialize the count
  480.     .XCREF    .CNT.            ;; Don't cref this either
  481.     .CREF                ;; Turn the CREF stuff back on
  482. IFNB <ARGS><
  483.     IRP <ARGS><
  484.     PUSH    P,ARGS            ;; Put an item on the stack
  485.     .CNT.==.CNT.+1            ;; Increment the count
  486.     >;; End of IRP
  487. >;; IFNB <ARGS>
  488.     PUSHJ    P,ROUTINE        ;; Call the BLISS routine
  489. IFN .CNT.,<
  490.     ADJSP    P,-.CNT.        ;; Remove the items from the stack
  491. >;; End of IFN .CNT.
  492. >; End of BLSCAL macro definition
  493.     SUBTTL    Definitions -- Macro -- KERRORS - Things passed to BLISS
  494.  
  495. ;+
  496. ;.HL1 KERRORS
  497. ;The following are the items that are passed back to the BLISS-36 routines.
  498. ;-
  499.  
  500. DEFINE    KERRORS<
  501. KER NORMAL,013,<Normal return>
  502. KER INTERNALERR,022,<Internal error>
  503. KER LINTOOLNG,102,<Command line too long>
  504. KER EOF,113,<End of file reached>
  505. KER RMS32,122,<!AS for !AS>
  506. KER NOMORFILES,133,<No more files>
  507. KER ILLFILTYP,142,<Illegal file type>
  508. KER REC%TOO%BIG,152,<Record to big for KERMIT's internal buffers>
  509. KER ERRMSG,162,<Received an E (error) packet>
  510. KER CHKSUMERR,172,<Checksum error>
  511. KER SNDERR,202,<Send failure>
  512. KER RETRIES,212,<Too many retries>
  513. KER EXIT,223,<Server requested exit>
  514. KER UNIMPLGEN,232,<Unimplemented generic command>
  515. KER UNISRV,242,<Unimplemented server command>
  516. KER PROTOERR,252,<Protocol error>
  517. KER ZEROLENMSG,262,<Zero length message>
  518. KER LINTERM,272,<Line specified is not a terminal>
  519. KER TIMEOUT,300,<Timed out waiting to receive/send packet>
  520. KER ABORTED,312,<Transfer aborted by user interrupt>
  521. KER RECERR,322,<Receive error - !AS>
  522. >; End of KERRORS macro definition
  523.  
  524. DEFINE    KER(TYPE,VALUE,TEXT)<TYPE=VALUE>
  525.     KERRORS
  526.     SUBTTL    Definitions -- Macro -- $KERR - Issue error messages
  527.  
  528. ;+
  529. ;.hl1 $KERR
  530. ;This macro will cause an error message to be issued.
  531. ;-
  532.  
  533. DEFINE    $KERR(Message)<
  534. TOPS10<
  535.     $TEXT    (,<?Kermit-10 Message>)
  536. >; End of TOPS10 conditional
  537. TOPS20<
  538.     $TEXT    (,<?Kermit-20 Message>)
  539. >; End of TOPS20 conditional
  540. >; End of $KERR macro definition
  541.     SUBTTL    Definitions -- Macro -- KERERR - Issue an error to the remote
  542.  
  543. ;+
  544. ;.hl1 KERERR
  545. ;This macro is used to issue an error message to the remote KERMIT.
  546. ;.LITERAL
  547. ;
  548. ; Usage:
  549. ;    KERERR    (<Text>)
  550. ;    (Return here)
  551. ;
  552. ;.end literal
  553. ;-
  554.  
  555. DEFINE    KERERR(TEXT)<
  556.     GLOB    <.KERERR>
  557.     $CALL    .KERERR
  558.     JUMP    [ITEXT(TEXT)]
  559. >; End of KERERR macro definition
  560.     SUBTTL    Definitions -- Macro -- Character masks
  561.  
  562. ;+
  563. ;.hl1 Character mask macros
  564. ; The following set of macros will define a four word bit map, with
  565. ;each bit corresponding to a single ascii character.  Only the first
  566. ;32 bits of each word are used.  This is compatible with the corresponding
  567. ;macro in MACSYM, the usage of character masks in TOPS-20 JSYS's, and
  568. ;the usage in TECO.
  569. ;
  570. ;.hl2 BRINI$
  571. ; This macro will initialize the masks.
  572. ;.literal
  573. ;
  574. ; Usage:
  575. ;    BRINI$(NAME)
  576. ;
  577. ; Where: NAME is the name to be used for building the mask. It should not
  578. ;     be more than 3 characters, as it is used to generate symbol names.
  579. ;
  580. ;.end literal
  581. ;-
  582.  
  583. DEFINE BRINI$(NAME,INIT),<
  584.     IFNB <INIT>,<
  585.         %.0'NAME==%.0'INIT ;; Copy the initial values (if any)
  586.         %.1'NAME==%.1'INIT
  587.         %.2'NAME==%.2'INIT
  588.         %.3'NAME==%.3'INIT
  589.     > ;; End of IFNB <INIT>
  590.     IFB <INIT>,<
  591.         %.0'NAME==<%.1'NAME==0> ;; If no initial value, use 0
  592.         %.2'NAME==<%.3'NAME==0>
  593.     > ;; End of IFB <INIT>
  594. > ; End of DEFINE BRINI$
  595.  
  596. ;; Now define the macros for adding an removing characters
  597.  
  598. DEFINE BRKCH$(NAME,FIRST,LAST)<
  599.     $$$VAL==FIRST
  600.     $$$VL1==FIRST
  601.     IFNB <LAST>,<$$$VL1==LAST>
  602.     .XCREF $$$VAL,$$$VL1
  603.     BRK$$$(NAME,$$$VAL,$$$VL1,!)
  604.     SUPPRESS $$$VAL,$$$VL1
  605. > ;; End of BRKCH$
  606.  
  607. DEFINE UNBRK$(NAME,FIRST,LAST)<
  608.     $$$VAL==FIRST
  609.     $$$VL1==FIRST
  610.     IFNB <LAST>,<$$$VL1==LAST>
  611.     .XCREF $$$VAL,$$$VL1
  612.     BRK$$$(NAME,$$$VAL,$$$VL1,&^-)
  613.     SUPPRESS $$$VAL,$$$VL1
  614. > ;; End of UNBRK$
  615.  
  616.  
  617.  
  618. DEFINE BRK$$$(NAME,FIRST,LAST,OP)<
  619.     $$$FST==FIRST        ;; Get initial value
  620.     $$$LST==LAST        ;; Get final value
  621.     .XCREF $$$FST,$$$LST
  622.     REPEAT $$$LST-$$$FST+1,<
  623.         $$$WRD==$$$FST/^D32    ;; Determine which word gets this char
  624.         $$$BIT==$$$FST-<$$$WRD*^D32> ;; And determine the bit
  625.         IFE $$$WRD-4,<        ;; Special 'char' for TECO?
  626.             $$$WRD==3    ;; Yes, put in 3rd word
  627.             $$$BIT==$$$BIT+^D32 ;; After 32'nd bit
  628.         > ;; End of IFE $$$WRD-4
  629.         BR$$$$(NAME,\"<$$$WRD+"0">,$$$BIT,OP)
  630.         $$$FST==$$$FST+1
  631.     > ;; End of REPEAT
  632. > ; End of BRK$$$
  633.  
  634. DEFINE BR$$$$(NAME,WORD,BIT,OP)<%.'WORD'NAME==%.'WORD'NAME'OP'1B<BIT>>
  635.  
  636.  
  637. DEFINE BRGEN$(NAME)<EXP %.0'NAME,%.1'NAME,%.2'NAME,%.3'NAME>
  638.  
  639. DEFINE BRWRD$(NAME,INDEX),<%.'INDEX'NAME>
  640.  
  641.  
  642. ; Now generate some common masks
  643.  
  644.     BRINI$(ALL)            ; All characters
  645.     BRKCH$(ALL,0,177)        ;  .  .  .
  646.     SUBTTL    End of KERUNV
  647.  
  648.     END
  649.