home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8709 / 18 < prev    next >
Encoding:
Text File  |  1990-07-13  |  44.8 KB  |  1,147 lines

  1. Path: uunet!seismo!sundc!pitstop!sun!amdcad!ames!ll-xn!husc6!spdcc!m2c!necntc!ncoast!allbery
  2. From: dave@safari.UUCP
  3. Newsgroups: comp.sources.misc
  4. Subject: SHOW TERMINAL for VAX/VMS
  5. Keywords: vms, not-shar, not-c
  6. Message-ID: <4770@ncoast.UUCP>
  7. Date: 29 Sep 87 20:36:40 GMT
  8. Sender: allbery@ncoast.UUCP
  9. Lines: 1134
  10. Approved: allbery@ncoast.UUCP
  11. X-Archive: comp.sources.misc/8709/18
  12.  
  13. An Improved VAX/VMS "SHOW TERMINAL" Display        -D.A. Munroe
  14.  
  15.  
  16. How many times have you typed "SHOW TERMINAL" only to spend time
  17. hunting around the display for the set of characteristics you need to
  18. know about?  This program not only displays terminal characteristics
  19. in a much more organized format, but also shows some additional ones
  20. such as modem signals.  A sample display is shown below.
  21.  
  22. The program is written in MACRO, so anyone with VAX/VMS can use it.  
  23. Once installed as a foreign command, it behaves just like the regular 
  24. "SHOW TERMINAL", with the exception that output cannot be sent to 
  25. disk.
  26.  
  27.  
  28.  
  29. Terminal:           _TXD1:              Owner process:      TA1
  30. Device type:        FT2                 Username:           TYPESETTING
  31.  
  32.  
  33. --- speed ---       --- comm. line ---  --- flow ---        ---  generic  ---
  34. Transmit: 9600      Full duplex         No Host sync        Scope
  35. Receive:  9600      No Modem            No TT sync          No ANSI CRT
  36. No Autobaud         No Dialup line      No Read sync        No DEC CRT
  37. No Set speed priv   No Remote           No Force XON        No DEC CRT2
  38.                     No Hangup           Type ahead          No Block mode
  39. --- bits ---        No Modify hangup    Alt. type ahead     No Edit mode
  40. Passall             No Disconnect proc  DMA                 No Advanced video
  41. Pasthru                                 CR fill: 0          No Printer port
  42. No Escape                               LF fill: 0          No Soft characters
  43. Eightbit            --- format ---                          No SIXEL graphics
  44. No Fallback         Width:  80                              No ReGIS graphics
  45. Odd Parity          Page:   24          --- user/appl ---
  46. Terminate on errors No Wrap             No Broadcast
  47.                     Lowercase           Line editing
  48.                     Tab                 Overstrike editing
  49. --- security ---    Form                Numeric Keypad
  50. No Secure server    No Echo             MBX Enable
  51. No Sys. password    No Local echo       No Broadcast MBX
  52.  
  53. ------------------------  Cut Here  ---------------------------------
  54.  
  55.                 .title  TERM  Improved "Show Terminal"
  56. ;----------------------------------------------------------------
  57. ;       TERM                            3/87  D.A. Munroe
  58. ;
  59. ;       This utility improves upon the SHOW TERMINAL command,
  60. ;       not only by displaying more terminal characteristics,
  61. ;       but by showing those characteristics in terms of these
  62. ;       basic categories:
  63. ;
  64. ;               - transmission speed
  65. ;               - bit interpretation
  66. ;               - communication
  67. ;               - terminal formatting
  68. ;               - flow control
  69. ;               - user and application settings
  70. ;               - generic capabilities
  71. ;
  72. ;       status:
  73. ;               output can only be to a terminal, but the program is
  74. ;               otherwise complete
  75. ;
  76. ;
  77. ;       notes:
  78. ;               should be installed or used with the priviliges: log_io,
  79. ;               share, world, and sysprv.
  80. ;
  81. ;               comments, corrections, and suggestions should be sent to:
  82. ;
  83. ;                       David A. Munroe
  84. ;                       Capital Cities Communications/ABC
  85. ;                       7818 SE Stark Ave
  86. ;                       Portland, Oregon  97215
  87. ;                       (503) 251-7533
  88. ;
  89. ;               uucp:   ...tektronix!reed!omen!safari!dave
  90. ;                       ...ptsfa!safari!dave
  91. ;                       ...ihnp4!safari!dave
  92. ;               
  93. ;
  94. ;       Revision history:
  95. ;
  96. ;       v1.00   13-Mar-87  dm   Initial release
  97. ;       v1.01   06-Apr-87  dm   Use "Hardcopy" instead of "No Scope"
  98. ;
  99. ;------------------------------------------------------------------------
  100.  
  101.  
  102.                                                 ; Bring in definitions
  103.                 $DVIDEF                         ; for dvi item codes
  104.                 $DEVDEF                         ; for device characteristics
  105.                 $JPIDEF                         ; for device owner & username
  106.                 $DCDEF                          ; for device class request
  107.                 $TTDEF                          ; for basic characteristics
  108.                 $TT2DEF                         ; for extended characteristics
  109.  
  110. ; macro to generate general purpose string descriptor
  111.  
  112.                 .macro  string_dsc      buffer, size
  113.                 .word           size            ; output buffer size
  114.                 .byte           DSC$K_DTYPE_T   ; text data type
  115.                 .byte           DSC$K_CLASS_S   ; string descriptor class
  116.                 .address        buffer          ; address of output buffer
  117.                 .endm
  118.  
  119. ; macro to generate general purpose item descriptor
  120.  
  121.                 .macro  item_dsc        item, buffer, size, return_length_address
  122.                 .word           size            ; output buffer size
  123.                 .word           item            ; item code (e.g. $DVI$_*)
  124.                 .address        buffer          ; output buffer
  125.                 .address        return_length_address
  126.                 .endm
  127.  
  128.  
  129.  
  130.                 .ident  \v1.01\                         ; 06-Apr-1987,  D.A. Munroe
  131.                 .psect  CODE,nowrt,exe
  132.                 .entry  TERM,^m<r2,r3,r4,r5,r6,r7,r8>   ; movc3 stomps on r0..r5
  133.  
  134. ;----------------------------------------------------------------
  135. ;       Assign an I/O channel to SYS$OUTPUT
  136. ;----------------------------------------------------------------
  137.  
  138.                 $assign_s -
  139.                         devnam  = outdev_dsc,-
  140.                         chan    = outdev_chan
  141.  
  142.                 blbs    r0,gcml
  143.                 brw     exit
  144.  
  145.  
  146.  
  147. ;----------------------------------------------------------------
  148. ;       Look at the command line to determine the terminal
  149. ;       under test.   If TERM is invoked with a command
  150. ;       line such as:
  151. ;                       $ TERM OPA0
  152. ;
  153. ;       then the effect of calling lib$get_foreign is to
  154. ;       put "OPA0" in tt_buff (via tt_dsc).
  155. ;----------------------------------------------------------------
  156.  
  157. gcml:           pushaw  tt_len                  ; where to put length of terminal name
  158.                 clrl    -(sp)                   ; no prompt string
  159.                 pushaq  tt_dsc                  ; descriptor for terminal name
  160.                 calls   #3,g^lib$get_foreign    ; look at command line
  161.                 blbs    r0,assn_term            ; continue if ok
  162.                 brw     exit
  163.  
  164.  
  165.  
  166. ;----------------------------------------------------------------
  167. ;       Assign an I/O channel to the terminal under test.
  168. ;       If no terminal name was given, we use SYS$OUTPUT.
  169. ;       We need to do this in order to give tt_chan to the
  170. ;       $QIO, below.
  171. ;----------------------------------------------------------------
  172. assn_term:
  173.                 tstw    tt_len                  ; any terminal specified?
  174.                 bneq    10$                     ; branch if so
  175.  
  176.                                                 ; otherwise use SYS$OUTPUT
  177.                 movc3   #outdev_size,outdev_dsc,tt_dsc
  178.                 movw    outdev_chan,tt_chan
  179.  
  180. 10$:            $assign_s -
  181.                         devnam  = tt_dsc,-
  182.                         chan    = tt_chan
  183.  
  184.                 blbs    r0,20$
  185.                 brw     exit
  186.  
  187. 20$:
  188.  
  189.  
  190. ;----------------------------------------------------------------
  191. ;       Get terminal characteristics associated with the
  192. ;       device on tt_chan.  The IO$_SENSEMODE request provides
  193. ;       additional terminal characteristics than that given by
  194. ;       $GETDVI
  195. ;----------------------------------------------------------------
  196. get_ch:
  197.                 $qiow_s -
  198.                         efn     = #0,-
  199.                         chan    = tt_chan,-
  200.                         func    = #IO$_SENSEMODE,-
  201.                         iosb    = sense_iosb,-
  202.                         p1      = ch_buff,-
  203.                         p2      = #ch_size
  204.  
  205.                 blbs    r0,10$
  206.                 brw     exit
  207.  
  208. 10$:            movzwl  sense_iosb,r0
  209.                 blbs    r0,20$
  210.                 brw     exit
  211. 20$:
  212.  
  213.  
  214. ;----------------------------------------------------------------
  215. ;       If the terminal has the modem characteristic, look at
  216. ;       the modem signals.   This is also a good time to place
  217. ;       those signals in the prototype screen.
  218. ;----------------------------------------------------------------
  219. get_modem_ch:
  220.                 bbs     #TT$V_MODEM,ch_basic,5$
  221.                 brw     70$                                     ; branch if not modem
  222.  
  223. 5$:             $qiow_s -
  224.                         efn     = #0,-
  225.                         chan    = tt_chan,-
  226.                         func    = #IO$_SENSEMODE!IO$M_RD_MODEM,-
  227.                         iosb    = modem_iosb,-
  228.                         p1      = modem_buff
  229.  
  230.                 blbs    r0,10$
  231.                 brw     exit
  232.  
  233. 10$:            movzwl  modem_iosb,r0
  234.                 blbs    r0,20$
  235.                 brw     exit
  236.  
  237. 20$:            bbc     #TT$V_DS_DSR,modem_buff+2,21$           ; show any modem signals
  238.                 movl    dsr,dsr_msg
  239. 21$:            bbc     #TT$V_DS_RING,modem_buff+2,22$
  240.                 movl    ri,ri_msg
  241. 22$:            bbc     #TT$V_DS_CARRIER,modem_buff+2,23$
  242.                 movl    cd,cd_msg
  243. 23$:            bbc     #TT$V_DS_CTS,modem_buff+2,24$
  244.                 movl    cts,cts_msg
  245. 24$:            bbc     #TT$V_DS_SECREC,modem_buff+2,25$
  246.                 movl    srd,srd_msg
  247. 25$:            
  248. 70$:
  249. ;----------------------------------------------------------------
  250. ;       Deassign the channel
  251. ;       (otherwise we will appear as the terminal owner)
  252. ;----------------------------------------------------------------
  253. deassign:
  254.                 $dassgn_s -
  255.                         chan    = tt_chan
  256.  
  257.                 blbs    r0,10$
  258.                 brw     exit
  259. 10$:
  260.  
  261.  
  262. ;----------------------------------------------------------------
  263. ;       Get device information (e.g. terminal name)
  264. ;----------------------------------------------------------------
  265. dev_info:
  266.                 $getdviw_s -
  267.                         efn     = #0,-
  268.                         devnam  = tt_dsc,-
  269.                         itmlst  = device_itemlist,-
  270.                         iosb    = dvi_iosb
  271.  
  272.                 blbs    r0,30$
  273.                 brw     exit
  274.  
  275. 30$:            movzwl  dvi_iosb,r0
  276.                 blbs    r0,40$
  277.                 brw     exit
  278.  
  279. 40$:
  280.                 movw    devnam_retlen,r0
  281.                 beql    45$
  282.                 movc3   r0,devnam_buff,term_name
  283.                 brb     50$
  284.  
  285. 45$:            movc3   devnam2_retlen,devnam2_buff,term_name
  286. 50$:
  287.  
  288.  
  289. ;----------------------------------------------------------------
  290. ;       Get terminal owner and username
  291. ;----------------------------------------------------------------
  292. job_info:
  293.                 tstl    pid_buff                ; does the terminal have an owner?
  294.                 bneq    20$                     ; if so, find owner & username
  295.                 tstl    pid2_buff               ; else check secondary characteristics
  296.                 beql    10$                     ; branch if really no owner
  297.                 movl    pid2_buff,pid_buff      ; set owner pid for $GETJPI call
  298.                 brb     20$                     ; find owner & username
  299.  
  300.                                                 ; arrive here if no owner
  301. 10$:            movc3   #no_owner_size,no_owner_msg,owner_msg
  302.                 brb     70$
  303.  
  304. 20$:            $getjpiw_s -
  305.                         efn     = #0,-
  306.                         pidadr  = pid_buff,-
  307.                         itmlst  = job_itemlist,-
  308.                         iosb    = jpi_iosb
  309.  
  310.                 blbs    r0,30$
  311.                 brw     exit
  312.  
  313. 30$:            movzwl  jpi_iosb,r0
  314.                 blbs    r0,40$
  315.                 brw     exit
  316.  
  317. ;----------------------------------------------------------------
  318. ;       Although VMS blank fills the username, the process name
  319. ;       is zero filled, so we have to move it from a separate
  320. ;       buffer.
  321. ;----------------------------------------------------------------
  322. 40$:            movc3   owner_retlen,owner_buff,owner_msg       ; set owner name
  323.  
  324. 70$:
  325.  
  326.  
  327. ;----------------------------------------------------------------
  328. ;  Here we scan the basic and extended characteristics bits and
  329. ;  modify the display accordingly.  In order to understand the
  330. ;  method used, we need to consider column alignment.  For
  331. ;  example:
  332. ;
  333. ;       No Modem             No TT Sync           No ANSI CRT
  334. ;       No Dialup line       No Read sync         No DEC CRT
  335. ;
  336. ;  When the "No "-condition is not present, we cannot simply
  337. ;  blank it out, because that would produce a ragged looking
  338. ;  display:
  339. ;
  340. ;          Modem             No TT Sync              ANSI CRT
  341. ;       No Dialup line          Read sync            DEC CRT
  342. ;
  343. ;  The following technique is efficient with both memory and
  344. ;  time: a prototype screen in memory will have characteristics
  345. ;  given in their "asserted" form, such as "Wrap" (as opposed
  346. ;  to "No Wrap").  For "normal" characteristics, such as "Wrap",
  347. ;  a clear bit indicates "No Wrap" and a set bit indicates "Wrap".
  348. ;  We check the characteristic, and if it's set, we leave the
  349. ;  screen alone.  If it's clear, we move the text right by three
  350. ;  characters and insert a "No ".  Note that we couldn't have
  351. ;  used the reverse method (with the prototype having the "No "
  352. ;  initially, and moving the text left) since that would leave
  353. ;  trailing characters on the right.
  354. ;
  355. ;  Some characteristics are "inverted", such as "No Broadcast".
  356. ;  Here, a clear bit means "Broadcast" and a set one means "No
  357. ;  Broadcast".  To handle this, we use a longword bit map to
  358. ;  indicate whether a characteristic is normal or inverted, and
  359. ;  decide what to do based on that.  Also, some characteristics
  360. ;  (such as those for parity) require special handling, so there
  361. ;  is a longword bit map for those, too.
  362. ;----------------------------------------------------------------
  363.  
  364. text_size       =       15.                             ; excludes "No "
  365.  
  366.                 clrl    r6                              ; r6 = bit index
  367.                 movab   line1,r7                        ; r7 = address of line1
  368. basic_loop:
  369.                 bbs     r6,basic_special,60$            ; branch (ignore) if special
  370.                 bbc     r6,basic_attr,20$               ; branch if inverted
  371.                                                         ; else attribute is normal
  372.                 bbs     r6,ch_basic,60$                 ; bit set means leave alone
  373. 10$:            movzwl  o_basic[r6],r8                  ; grab offset to display entry
  374.                 addl2   r7,r8                           ; get absolute pointer to it
  375.                 movc3   #text_size,(r8),3(r8)           ; shift right 3 characters
  376.                 movw    #^a\No\,(r8)                    ; insert "No"
  377.                 movb    #^a\ \,2(r8)                    ; insert " "
  378.                 brb     60$
  379.  
  380. 20$:            bbs     r6,ch_basic,10$                 ; bit set means put in "No "
  381.  
  382. 60$:            aobleq  #basic_count,r6,basic_loop
  383.  
  384. ;----------------------------------------------------------------
  385. ;       Loop for testing extended characteristics
  386. ;----------------------------------------------------------------
  387.                 clrl    r6                              ; clear bit index
  388. extend_loop:
  389.                 bbs     r6,extend_special,60$           ; branch (ignore) if special
  390.                 bbc     r6,extend_attr,20$              ; branch if inverted
  391.                                                         ; else attribute is normal
  392.                 bbs     r6,ch_extend,60$                ; bit set means leave alone
  393. 10$:            movzwl  o_extend[r6],r8                 ; grab offset to display entry
  394.                 addl2   r7,r8                           ; get absolute pointer to it
  395.                 movc3   #text_size,(r8),3(r8)           ; shift right 3 characters
  396.                 movw    #^a\No\,(r8)                    ; insert "No"
  397.                 movb    #^a\ \,2(r8)                    ; insert " "
  398.                 brb     60$
  399.  
  400. 20$:            bbs     r6,ch_extend,10$                ; bit set means put in "No "
  401.  
  402. 60$:            aobleq  #extend_count,r6,extend_loop
  403.  
  404.  
  405. ;----------------------------------------------------------------
  406. ;       Here we put in special descriptions.  For example,
  407. ;       instead of "No Passall" we have "Interactive".
  408. ;----------------------------------------------------------------
  409. specials:
  410.                                                         ; passall/interactive
  411.                 bbs     #TT$V_PASSALL,ch_basic,10$
  412.                 movc3   #interactive_size,interactive,passall_msg
  413.  
  414.                                                         ; half/full duplex
  415. 10$:            bbs     #TT$V_HALFDUP,ch_basic,20$
  416.                 movc3   #fullduplex_size,fullduplex,halfduplex_msg
  417.  
  418.                                                         ; insert/overstrike editing
  419. 20$:            bbs     #TT2$V_INSERT,ch_extend,30$
  420.                 movc3   #overstrike_size,overstrike,insert_edit_msg
  421.  
  422.                                                         ; application/numeric keypad
  423. 30$:            bbs     #TT2$V_APP_KEYPAD,ch_extend,40$
  424.                 movc3   #numeric_size,numeric,keypad_msg
  425.  
  426.                                                         ; mailbox disable/enable
  427. 40$:            bbs     #TT$V_MBXDSABL,ch_basic,50$
  428.                 movc3   #mbxenable_size,mbxenable,mbxdisable_msg
  429.  
  430.  
  431. DISMISS_PARITY  =       1                               ;  TT$V_DISPARERR is defined as 9, it should be 1
  432.  
  433. 50$:            bbc     #TT$V_PARITY,sense_iosb+6,60$           ; branch if no parity
  434.                 bbc     #DISMISS_PARITY,sense_iosb+6,52$        ; branch if terminating on parity errors
  435.                 movc3   #dismiss_size,dismiss,parity_err_msg
  436.                 brb     54$
  437.  
  438. 52$:            movc3   #terminate_size,terminate,parity_err_msg
  439.  
  440. 54$:            bbs     #TT$V_ODD,sense_iosb+6,56$              ; branch if odd parity
  441.                 movc3   #evenparity_size,evenparity,parity_msg
  442.                 brb     60$
  443.  
  444. 56$:            movc3   #oddparity_size,oddparity,parity_msg
  445. 60$:
  446.                 bbc     #DEV$V_SPL,devchar_buff,70$             ; branch if not spooled
  447.                 movc3   spooldev_retlen,spooldev_buff,spooldev_msg
  448.                 movc3   #spooled_size,spooled,spooled_msg
  449.  
  450.                                                         ; Scope/Hardcopy
  451. 70$:            bbs     #TT$V_SCOPE,ch_basic,77$
  452.                 movc3   #hardcopy_size,hardcopy,scope_msg
  453. 77$:
  454.  
  455.  
  456. ;----------------------------------------------------------------
  457. ;       Format numerical values (baud rate, screen width, etc.)
  458. ;----------------------------------------------------------------
  459. format:
  460.                                                 ; transmit speed
  461.                 movzbl  sense_iosb+2,r0         ; look up encoded baudrate
  462.                 movl    baudrate[r0],r0         ; get numeric value of baudrate
  463.                 $fao_s -
  464.                         ctrstr  = transmit_fmt,-        ; descriptor for format control string
  465.                         outlen  = out_len,-             ; where to store length of formatted output
  466.                         outbuf  = transmit_dsc,-        ; descriptor for formatted output buffer
  467.                         p1      = r0                    ; where the transmit speed resides
  468.                 blbs    r0,10$
  469.                 brw     exit
  470.  
  471. 10$:                                            ; receive speed
  472.                 tstb    sense_iosb+3            ; receive speed same as transmit?
  473.                 bneq    15$                     ; branch if different
  474.                 movc3   #transmit_size,transmit_val,receive_val
  475.                 brb     20$
  476.  
  477. 15$:            movzbl  sense_iosb+3,r0         ; look up encoded baudrate
  478.                 movl    baudrate[r0],r0         ; get numeric value of baudrate
  479.                 $fao_s -                        ; receive speed
  480.                         ctrstr  = receive_fmt,-
  481.                         outlen  = out_len,-
  482.                         outbuf  = receive_dsc,-
  483.                         p1      = r0
  484.                 blbs    r0,20$
  485.                 brw     exit
  486.  
  487. 20$:            $fao_s -                        ; terminal page width
  488.                         ctrstr  = width_fmt,-
  489.                         outlen  = out_len,-
  490.                         outbuf  = width_dsc,-
  491.                         p1      = ch_pgwid
  492.                 blbs    r0,30$
  493.                 brw     exit
  494.  
  495. 30$:            $fao_s -                        ; terminal page length
  496.                         ctrstr  = page_fmt,-
  497.                         outlen  = out_len,-
  498.                         outbuf  = page_dsc,-
  499.                         p1      = ch_pglen
  500.                 blbs    r0,40$
  501.                 brw     exit
  502.  
  503. 40$:            $fao_s -                        ; CR fill
  504.                         ctrstr  = cr_fill_fmt,-
  505.                         outlen  = out_len,-
  506.                         outbuf  = cr_fill_dsc,-
  507.                         p1      = sense_iosb+4
  508.                 blbs    r0,50$
  509.                 brw     exit
  510.  
  511. 50$:            $fao_s -                        ; LF fill
  512.                         ctrstr  = lf_fill_fmt,-
  513.                         outlen  = out_len,-
  514.                         outbuf  = lf_fill_dsc,-
  515.                         p1      = sense_iosb+5
  516.                 blbs    r0,60$
  517.                 brw     exit
  518. 60$:
  519.  
  520.  
  521. ;----------------------------------------------------------------
  522. ;       Find the terminal type
  523. ;
  524. ;       Entries in the terminal list table have the form:
  525. ;
  526. ;               .byte   term_id
  527. ;               .byte   length_of_terminal_name
  528. ;               .ascii  \terminal_name\
  529. ;
  530. ;       The last entry in the table has an id of 0
  531. ;
  532. ;----------------------------------------------------------------
  533.                 movb    ch_type,r0              ; r0 is terminal id
  534.                 movab   terminal_list,r1        ; r1 = ptr to list of id's
  535. 70$:            movb    (r1)+,r2                ; look at next id in table
  536.                 beql    75$                     ; if entry = 0, not found
  537.                 cmpb    r0,r2                   ; terminal id matches entry?
  538.                 beql    75$                     ; branch if match
  539.                 movzbl  (r1)+,r2                ; for longw arith. with count
  540.                 addl2   r2,r1                   ; skip to next entry
  541.                 brb     70$
  542. 75$:                                            ; at match or "Unknown" entry
  543.                 movb    (r1)+,r0                ; r0 = character count
  544.                 movc3   r0,(r1),term_type
  545.  
  546.  
  547. ;----------------------------------------------------------------
  548. ;               Show prototype screen
  549. ;----------------------------------------------------------------
  550.                 $qiow_s -
  551.                         efn     = #0,-
  552.                         chan    = outdev_chan,-
  553.                         func    = #IO$_WRITEVBLK,-
  554.                         iosb    = write_iosb,-
  555.                         p1      = line1,-
  556.                         p2      = #screen_size,-
  557.                         p4      = #0
  558.  
  559.                 blbc            r0,exit
  560.                 movzwl          write_iosb,r0
  561.  
  562. exit:           ret
  563.  
  564.  
  565.                 .psect  RWDATA,wrt,noexe
  566. ;----------------------------------------------------------------
  567. ;       Data structures for the $ASSIGN service
  568. ;----------------------------------------------------------------
  569. outdev_chan:    .blkw
  570. outdev_dsc:     .ascid  \SYS$OUTPUT\
  571. outdev_size     =       . - outdev_dsc
  572.  
  573. tt_chan:        .blkw
  574.  
  575. tt_buffsize     =       32.
  576. tt_dsc:                                         ; descriptor for the terminal
  577. tt_len:         .word           tt_buffsize     ; in: tt_buff size;  out: length of terminal name
  578.                 .byte           DSC$K_DTYPE_T   ; text data type
  579.                 .byte           DSC$K_CLASS_S   ; string descriptor class
  580.                 .address        tt_buff         ; address of terminal name
  581.  
  582. tt_buff:        .blkb           tt_buffsize     ; for name of terminal we're interested in
  583.  
  584.  
  585. ;----------------------------------------------------------------
  586. ;       Data structures for the $GETDVI service
  587. ;
  588. ;       If the terminal is spooled, the primary characteristics
  589. ;       are for the intermediate device (i.e. the disk) and the
  590. ;       secondary characteristics are those of the terminal
  591. ;----------------------------------------------------------------
  592. device_itemlist:                                ; list of addresses for items we want
  593.                 item_dsc -
  594.                         DVI$_DEVCHAR!DVI$C_SECONDARY,-
  595.                         devchar_buff,devchar_size,devchar_retlen
  596.  
  597.                 item_dsc -
  598.                         DVI$_PID,-
  599.                         pid_buff,pid_size,pid_retlen
  600.  
  601.                 item_dsc -
  602.                         DVI$_PID!DVI$C_SECONDARY,-
  603.                         pid2_buff,pid2_size,pid2_retlen
  604.  
  605.                 item_dsc -
  606.                         DVI$_TT_PHYDEVNAM,-
  607.                         devnam_buff,devnam_size,devnam_retlen
  608.  
  609.                 item_dsc -
  610.                         DVI$_TT_PHYDEVNAM!DVI$C_SECONDARY,-
  611.                         devnam2_buff,devnam2_size,devnam2_retlen
  612.  
  613.                 item_dsc -
  614.                         DVI$_DEVNAM,-
  615.                         spooldev_buff,spooldev_size,spooldev_retlen
  616.  
  617.                 .long           0
  618.  
  619. ;       data structures for device-independent characteristics
  620.  
  621. devchar_buff:   .blkl                           
  622. devchar_size    =               . - devchar_buff
  623. devchar_retlen: .blkw
  624.  
  625. ;       data structures for owner PID
  626.  
  627. pid_buff:       .blkl
  628. pid_size        =               . - pid_buff
  629. pid_retlen:     .blkw
  630.  
  631. ;       data structures for owner PID
  632. ;       (if primary pid was 0)
  633.  
  634. pid2_buff:      .blkl
  635. pid2_size       =               . - pid2_buff
  636. pid2_retlen:    .blkw
  637.  
  638. ;       data structures for physical device name
  639.  
  640. devnam_buff:    .blkb           64
  641. devnam_size     =               . - devnam_buff
  642. devnam_retlen:  .blkw
  643.  
  644. ;       data structures for physical device name
  645. ;       (if devnam_retlen was 0)
  646.  
  647. devnam2_buff:   .blkb           64
  648. devnam2_size    =               . - devnam2_buff
  649. devnam2_retlen: .blkw
  650.  
  651. ;       data structures for name of spooling device (if any)
  652.  
  653. spooldev_buff:  .blkb           64
  654. spooldev_size   =               . - spooldev_buff
  655. spooldev_retlen:.blkw
  656.  
  657. dvi_iosb:       .blkq
  658.  
  659.  
  660. ;----------------------------------------------------------------
  661. ;       Data structures for the $GETJPI service
  662. ;----------------------------------------------------------------
  663.  
  664. MAX_PROC_NAME   =               15
  665. MAX_USER_NAME   =               12
  666.  
  667. job_itemlist:                                   ; list of addresses for items we want
  668. owner_dsc:      item_dsc        JPI$_PRCNAM,owner_buff,MAX_PROC_NAME,owner_retlen
  669. username_dsc:   item_dsc        JPI$_USERNAME,username_msg,MAX_USER_NAME,username_retlen
  670.                 .long           0
  671.  
  672. owner_buff:     .blkb           MAX_PROC_NAME
  673. owner_retlen:   .blkw
  674.  
  675. username_retlen:.blkw
  676.  
  677. jpi_iosb:       .blkq
  678.  
  679.  
  680. ;----------------------------------------------------------------
  681. ;       Data structures for the $QIO service
  682. ;----------------------------------------------------------------
  683. ch_buff:                                        ; terminal characteristics buffer
  684.                 .byte           DC$_TERM        ; device class (input to $QIO)
  685. ch_type:        .blkb                           ; terminal type (e.g. vt100)
  686. ch_pgwid:       .blkw                           ; page width (max is 255)
  687. ch_basic:       .blkb           3               ; basic characteristics
  688. ch_pglen:       .blkb                           ; page length
  689. ch_extend:      .blkl                           ; extended characteristics
  690. ch_size         =               . - ch_buff
  691.  
  692. out_len:        .blkl
  693. write_iosb:     .blkq
  694. sense_iosb:     .blkq
  695. modem_iosb:     .blkq
  696. modem_buff:     .blkq
  697.  
  698.  
  699. ;----------------------------------------------------------------
  700. ;       Screen prototype
  701. ;
  702. ;       Text descriptions which can have a "No " prefixed to
  703. ;       them must be no longer than text_size bytes.
  704. ;----------------------------------------------------------------
  705.  
  706. cr              =               ^o15
  707. lf              =               ^o12
  708.  
  709. no_owner_msg:   .ascii          \no owner\
  710. no_owner_size   =               . - no_owner_msg
  711.  
  712. line1:
  713.                 .ascii          \Terminal:           \
  714. term_name:      .ascii          \                    \
  715.                 .ascii          \Owner process:      \
  716. owner_msg:      .ascii          \                  \<cr><lf>    ; should be MAX_PROC_NAME or larger
  717.  
  718. line2:
  719.                 .ascii          \Device type         \
  720. term_type:      .ascii          \                    \
  721.                 .ascii          \Username:           \
  722. username_msg:   .ascii          \                  \<cr><lf>    ; should be MAX_USER_NAME or larger
  723.  
  724. line3:
  725. spooled_msg:    .ascii          \                    \<cr><lf>
  726.  
  727. line4:          .ascii          <cr><lf>
  728.  
  729. line5:
  730.                 .ascii          \--- speed ---       --- comm. line ---  \
  731.                 .ascii          \--- flow ---        --- generic ---\<cr><lf>
  732.  
  733. line6:
  734.                 .ascii          \Transmit: \
  735. transmit_val:   .ascii          \          \
  736. transmit_size   =               . - transmit_val
  737. halfduplex      =               . - line1
  738. halfduplex_msg: .ascii          \Half duplex         \
  739. hostsync        =               . - line1
  740.                 .ascii          \Host sync           \
  741. scope           =               . - line1
  742. scope_msg:      .ascii          \Scope             \<cr><lf>
  743.  
  744. line7:
  745.                 .ascii          \Receive:  \
  746. receive_val:    .ascii          \          \
  747. receive_size    =               . - receive_val
  748. modem           =               . - line1
  749.                 .ascii          \Modem               \
  750. ttsync          =               . - line1
  751.                 .ascii          \TT sync             \
  752. ansi            =               . - line1
  753.                 .ascii          \ANSI CRT          \<cr><lf>
  754.  
  755. line8:
  756. autobaud        =               . - line1
  757.                 .ascii          \Autobaud            \
  758. dialup          =               . - line1
  759.                 .ascii          \Dialup line         \
  760. readsync        =               . - line1
  761.                 .ascii          \Read sync           \
  762. crt             =               . - line1
  763.                 .ascii          \DEC CRT           \<cr><lf>
  764.  
  765. line9:
  766. set_speed       =               . - line1
  767.                 .ascii          \Set speed priv      \
  768. remote          =               . - line1
  769.                 .ascii          \Remote              \
  770. force_xon       =               . - line1
  771.                 .ascii          \Force XON           \
  772. crt2            =               . - line1
  773.                 .ascii          \DEC CRT2          \<cr><lf>
  774.  
  775. line10:
  776.                 .ascii          \                    \
  777. hangup          =               . - line1
  778.                 .ascii          \Hangup              \
  779. type_ahead      =               . - line1
  780.                 .ascii          \Type ahead          \
  781. block           =               . - line1
  782.                 .ascii          \Block mode        \<cr><lf>
  783.  
  784. line11:
  785.                 .ascii          \--- bits ---        \
  786. modhangup       =               . - line1
  787.                 .ascii          \Modify hangup       \
  788. altypeahd       =               . - line1
  789.                 .ascii          \Alt. type ahead     \
  790. edit_mode       =               . - line1
  791.                 .ascii          \Edit mode         \<cr><lf>
  792.  
  793. line12:
  794. passall         =               . - line1
  795. passall_msg:    .ascii          \Passall             \
  796. disconnect      =               . - line1
  797.                 .ascii          \Disconnect proc     \
  798. dma             =               . - line1
  799.                 .ascii          \DMA                 \
  800. avo             =               . - line1
  801.                 .ascii          \Advanced video    \<cr><lf>
  802.  
  803. line13:
  804. pasthru         =               . - line1
  805.                 .ascii          \Pasthru             \
  806. dsr_msg:        .ascii          \    \
  807. ri_msg:         .ascii          \    \
  808. cd_msg:         .ascii          \    \
  809. cts_msg:        .ascii          \    \
  810. srd_msg:        .ascii          \    \
  811.                 .ascii          \CR fill: \
  812. cr_fill         =               . - line1
  813. cr_fill_val:    .ascii          \           \
  814. cr_fill_size    =               . - cr_fill_val
  815. printer         =               . - line1
  816.                 .ascii          \Printer port      \<cr><lf>
  817.  
  818. line14:
  819. escape          =               . - line1
  820.                 .ascii          \Escape              \
  821.                 .ascii          \                    \
  822.                 .ascii          \LF fill: \
  823. lf_fill         =               . - line1
  824. lf_fill_val:    .ascii          \           \
  825. lf_fill_size    =               . - lf_fill_val
  826. softchars       =               . - line1
  827.                 .ascii          \Soft characters   \<cr><lf>
  828.  
  829. line15:
  830. eightbit        =               . - line1
  831.                 .ascii          \Eightbit            \
  832.                 .ascii          \--- format ---      \
  833.                 .ascii          \                    \
  834. sixel           =               . - line1
  835.                 .ascii          \SIXEL graphics    \<cr><lf>
  836.  
  837. line16:
  838. fallback        =               . - line1
  839.                 .ascii          \Fallback            \
  840.                 .ascii          \Width:  \
  841. width_val:      .ascii          \            \
  842. width_size      =               . - width_val
  843.                 .ascii          \                    \
  844. regis           =               . - line1
  845.                 .ascii          \ReGIS graphics    \<cr><lf>
  846.  
  847. line17:
  848. parity          =               . - line1
  849. parity_msg:     .ascii          \No Parity           \
  850.                 .ascii          \Page:   \
  851. page_val:       .ascii          \            \
  852. page_size       =               . - page_val
  853.                 .ascii          \--- user/appl ---   \
  854.                 .ascii          <cr><lf>
  855.  
  856. line18:
  857. parity_err_msg: .ascii          \                    \
  858. wrap            =               . - line1
  859.                 .ascii          \Wrap                \
  860. broadcast       =               . - line1
  861.                 .ascii          \Broadcast           \
  862.                 .ascii          <cr><lf>
  863.  
  864. line19:
  865.                 .ascii          \                    \
  866. lowercase       =               . - line1
  867.                 .ascii          \Lowercase           \
  868. line_edit       =               . - line1
  869.                 .ascii          \Line editing        \
  870.                 .ascii          <cr><lf>
  871.  
  872. line20:
  873.                 .ascii          \                    \
  874. tab             =               . - line1
  875.                 .ascii          \Tab                 \
  876. insert_edit     =               . - line1
  877. insert_edit_msg:.ascii          \Insert editing      \
  878.                 .ascii          <cr><lf>
  879.  
  880. line21:
  881.                 .ascii          \--- security ---    \
  882. form            =               . - line1
  883.                 .ascii          \Form                \
  884. keypad          =               . - line1
  885. keypad_msg:     .ascii          \Application keypad  \
  886.                 .ascii          <cr><lf>
  887.  
  888. line22:
  889. secure          =               . - line1
  890.                 .ascii          \Secure server       \
  891. echo            =               . - line1
  892.                 .ascii          \Echo                \
  893. mbxdisable      =               . - line1
  894. mbxdisable_msg: .ascii          \MBX Disable         \
  895.                 .ascii          <cr><lf>
  896.  
  897. line23:
  898. syspassword     =               . - line1
  899.                 .ascii          \Sys. password       \
  900. local_echo      =               . - line1
  901.                 .ascii          \Local echo          \
  902. nobrdcstmbx     =               . - line1
  903.                 .ascii          \Broadcast MBX       \
  904.  
  905.                 .ascii          <cr>
  906. screen_size     =               . - line1
  907.                 .even
  908.  
  909.  
  910. ;----------------------------------------------------------------
  911. ;       Alternate descriptions for special characteristics
  912. ;----------------------------------------------------------------
  913. interactive:    .ascii          \Interactive\                   ;  overwrites "passall"
  914. interactive_size =              . - interactive
  915.  
  916. fullduplex:     .ascii          \Full duplex\                   ; overwrites "half duplex"
  917. fullduplex_size =               . - fullduplex
  918.  
  919. overstrike:     .ascii          \Overstrike editing\            ; overwrites "insert editing"
  920. overstrike_size =               . - overstrike
  921.  
  922. numeric:        .ascii          \Numeric keypad    \            ; overwrites "application keypad"
  923. numeric_size    =               . - numeric
  924.  
  925. mbxenable:      .ascii          \MBX Enable \                   ; overwrites "MBX disable"
  926. mbxenable_size  =               . - mbxenable
  927.  
  928. dismiss:        .ascii          \Dismiss parity errs\
  929. dismiss_size    =               . - dismiss
  930.  
  931. terminate:      .ascii          \Terminate on errors\
  932. terminate_size  =               . - terminate
  933.  
  934. hardcopy:       .ascii          \Hardcopy\
  935. hardcopy_size   =               . - hardcopy
  936.  
  937. ;  the even and odd parity messages overwrite "No Parity"
  938.  
  939. evenparity:     .ascii          \Even Parity\
  940. evenparity_size =               . - evenparity
  941.  
  942. oddparity:      .ascii          \Odd Parity\
  943. oddparity_size  =               . - oddparity
  944.  
  945. spooled:        .ascii          \Spooled to \
  946. spooldev_msg:   .ascii          \        \
  947. spooled_size    =               . - spooled
  948.  
  949. dsr:            .ascii          \DSR \
  950. ri:             .ascii          \RI  \
  951. cd:             .ascii          \CD  \
  952. cts:            .ascii          \CTS \
  953. srd:            .ascii          \SRD \
  954.  
  955.  
  956. ;----------------------------------------------------------------
  957. ;       offset_tables:  o_basic,  o_extend
  958. ;
  959. ;       Entries in these tables are ordered by the TT$V and TT2$V
  960. ;       bit numbers which represent terminal characteristics as
  961. ;       known by VMS.  The contents of an entry is the offset
  962. ;       into the screen display for that characteristic.
  963. ;----------------------------------------------------------------
  964.  
  965. UNUSED          =               0               ; also flagged in the *_special masks
  966.  
  967. o_basic:        .word           passall
  968.                 .word           echo
  969.                 .word           type_ahead
  970.                 .word           escape
  971.                 .word           hostsync
  972.                 .word           ttsync
  973.                 .word           UNUSED          ; script
  974.                 .word           lowercase
  975.                 .word           tab
  976.                 .word           wrap
  977.                 .word           cr_fill
  978.                 .word           lf_fill
  979.                 .word           scope
  980.                 .word           remote
  981.                 .word           UNUSED          ; holdscreen
  982.                 .word           eightbit
  983.                 .word           mbxdisable
  984.                 .word           broadcast
  985.                 .word           readsync
  986.                 .word           form
  987.                 .word           halfduplex
  988.                 .word           modem
  989.  
  990. basic_count     =               < . - o_basic > / 2     ; count of basic attributes
  991.  
  992.  
  993. o_extend:       .word           local_echo
  994.                 .word           autobaud
  995.                 .word           hangup
  996.                 .word           modhangup
  997.                 .word           nobrdcstmbx
  998.                 .word           force_xon
  999.                 .word           dma
  1000.                 .word           altypeahd
  1001.                 .word           set_speed
  1002.                 .word           UNUSED          ; dclmailbx
  1003.                 .word           UNUSED          ; dcloutbnd
  1004.                 .word           UNUSED          ; dclctrlc
  1005.                 .word           line_edit
  1006.                 .word           insert_edit
  1007.                 .word           fallback
  1008.                 .word           dialup
  1009.                 .word           secure
  1010.                 .word           disconnect
  1011.                 .word           pasthru
  1012.                 .word           syspassword
  1013.                 .word           sixel
  1014.                 .word           softchars
  1015.                 .word           printer
  1016.                 .word           keypad
  1017.                 .word           ansi
  1018.                 .word           regis
  1019.                 .word           block
  1020.                 .word           avo
  1021.                 .word           edit_mode
  1022.                 .word           crt
  1023.                 .word           crt2
  1024.  
  1025. extend_count    =               < . - o_extend > / 2    ; count of extended attributes
  1026.  
  1027.  
  1028. ;----------------------------------------------------------------
  1029. ;       bit masks:      basic_special, basic_attr
  1030. ;                       extend_special, extend_attr
  1031. ;
  1032. ;       Entries in these masks are ordered by the TT$V and TT2$V
  1033. ;       bit numbers which represent terminal characteristics as
  1034. ;       known by VMS.  The contents of an entry determines how
  1035. ;       the state of a bit affects the display.
  1036. ;
  1037. ;       For basic_special and extend_special:
  1038. ;
  1039. ;               0  =    not special
  1040. ;               1  =    special display handling required
  1041. ;
  1042. ;       For basic_attr and extend_attr:
  1043. ;
  1044. ;               1  =    "normal attribute" where the characteristic
  1045. ;                       bit means:
  1046. ;                                       0  =>  put in "No "
  1047. ;                                       1  =>  leave alone
  1048. ;
  1049. ;               0  =    "inverted attribute" where the characteristic
  1050. ;                       bit means:
  1051. ;                                       0  =>  leave alone
  1052. ;                                       1  =>  put in "No "
  1053. ;
  1054. ;----------------------------------------------------------------
  1055.  
  1056.  
  1057. basic_special:  .long           ^b0100010101110001000001
  1058. basic_attr:     .long           ^b1111011111111111111001
  1059.  
  1060. extend_special: .long           ^b0000000100000000010111000000000
  1061. extend_attr:    .long           ^b1111111111111111111111111111111
  1062.  
  1063.  
  1064. ;----------------------------------------------------------------
  1065. ;       Data structures for $FAO
  1066. ;----------------------------------------------------------------
  1067. transmit_fmt:   .ascid          \!SL\
  1068. receive_fmt:    .ascid          \!SL\
  1069. width_fmt:      .ascid          \!SW\
  1070. page_fmt:       .ascid          \!SB\
  1071. cr_fill_fmt:    .ascid          \!SB\
  1072. lf_fill_fmt:    .ascid          \!SB\
  1073.  
  1074. transmit_dsc:   string_dsc      transmit_val, transmit_size
  1075. receive_dsc:    string_dsc      receive_val, receive_size
  1076. width_dsc:      string_dsc      width_val, width_size
  1077. page_dsc:       string_dsc      page_val, page_size
  1078. cr_fill_dsc:    string_dsc      cr_fill_val, cr_fill_size
  1079. lf_fill_dsc:    string_dsc      lf_fill_val, lf_fill_size
  1080.  
  1081.  
  1082. ;----------------------------------------------------------------
  1083. ;       Baud rate table -- ordered by TT$C_BAUD_*
  1084. ;----------------------------------------------------------------
  1085.  
  1086. baudrate:       .long           0, 50, 75, 110, 134, 150, 300, 600, 1200, 1800, 2000, 2400
  1087.                 .long           3600, 4800, 7200, 9600, 19200, 38400
  1088.  
  1089.  
  1090. ;----------------------------------------------------------------
  1091. ;       Terminal type is indicated by a terminal-id number.
  1092. ;       These numbers have a large range and are not contiguous,
  1093. ;       so we have a macro to generate entries in the terminal
  1094. ;       type lookup table.
  1095. ;----------------------------------------------------------------
  1096.  
  1097.                 .macro  term_entry      term_id,term_name,?l1,?l2
  1098.                 .byte   term_id
  1099.                 .byte   l2 - l1         ; indicates length of name
  1100. l1:             .ascii  \term_name\
  1101. l2:
  1102.                 .endm
  1103.  
  1104. terminal_list:
  1105.  
  1106.                 term_entry      1,VT05
  1107.                 term_entry      2,VK100
  1108.                 term_entry      3,VT173
  1109.                 term_entry      10,TEK401x
  1110.                 term_entry      16,FT1
  1111.                 term_entry      17,FT2
  1112.                 term_entry      18,FT3
  1113.                 term_entry      19,FT4
  1114.                 term_entry      20,FT5
  1115.                 term_entry      21,FT6
  1116.                 term_entry      22,FT7
  1117.                 term_entry      23,FT8
  1118.                 term_entry      32,LA36
  1119.                 term_entry      33,LA120
  1120.                 term_entry      34,LA34
  1121.                 term_entry      35,LA38
  1122.                 term_entry      36,LA12
  1123.                 term_entry      37,LA100
  1124.                 term_entry      38,LQP02
  1125.                 term_entry      39,LA84
  1126.                 term_entry      40,LA210
  1127.                 term_entry      41,LN03
  1128.                 term_entry      42,LN01K
  1129.                 term_entry      43,LA80
  1130.                 term_entry      64,VT52
  1131.                 term_entry      65,VT55
  1132.                 term_entry      96,VT100
  1133.                 term_entry      97,VT101
  1134.                 term_entry      98,VT102
  1135.                 term_entry      99,VT105
  1136.                 term_entry      100,VT125
  1137.                 term_entry      101,VT131
  1138.                 term_entry      102,VT132
  1139.                 term_entry      103,VT80
  1140.                 term_entry      110,<VT200 Series>
  1141.                 term_entry      111,<Pro Series>
  1142.                 term_entry      0,Unknown
  1143.  
  1144.                 .end            TERM
  1145.  
  1146. ;-----------------  end of posting  ------------------------
  1147.