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