home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / extra / nyenhuis3.arc / MSSDEF.H < prev    next >
Text File  |  1990-01-16  |  13KB  |  380 lines

  1. ; File MSSDEF.H
  2.     .xlist            ; suppress listing in program
  3.     .sall            ; don't list macro expansions
  4. version equ    300        ; master version number
  5. verdef    macro
  6.     db    ' MS-Kermit: 3.00 16 Jan 1990'
  7.     endm
  8.  
  9. BELL    EQU    07H
  10. TAB     EQU    09H
  11. LF      EQU    0AH
  12. FF      EQU    0CH
  13. CR      EQU    0DH
  14. XON     EQU    11H
  15. XOFF    EQU    13H
  16. ESCAPE     EQU    1BH
  17. DEL     EQU    7FH
  18. BS      EQU    08H
  19. CTLZ    EQU    1AH
  20. SOH     EQU    01H     ; Start of header char
  21. SPC     EQU    20H
  22. SS2    equ    8eh
  23. SS3    equ    8fh
  24. DCS    equ    90h
  25. CSI    equ    9bh
  26. STCHR    equ    9ch
  27.  
  28. DOS     EQU    21H
  29.  
  30. CONIN    EQU    01H
  31. CONOUT    EQU    02H
  32. LSTOUT    EQU    05H
  33. DCONIO    EQU    06H
  34. CONINQ    EQU    07H    ; quiet console input
  35. PRSTR    EQU    09H
  36. CONSTAT    EQU    0BH
  37. SELDSK    EQU    0EH    ; Select disk
  38. GCURDSK    EQU    19H    ; Current disk
  39. SETDMA    EQU    1AH
  40. GETDATE EQU    2AH    ; Get date
  41. GETTIM    EQU    2CH    ; Get the time of day 
  42. DOSVER    EQU    30H    ; dos version #
  43. GSWITCH    EQU    37H    ; undocumented get/set switch character
  44. CHDIR    EQU    3BH    ; change directory
  45. CREAT2    EQU    3CH    ; create
  46. OPEN2    EQU    3DH    ; open
  47. CLOSE2    EQU    3EH    ; close
  48. READF2    EQU    3FH    ; read
  49. WRITE2    EQU    40H    ; write
  50. DEL2    EQU    41H    ; delete
  51. LSEEK    EQU    42H    ; lseek
  52. IOCTL    EQU    44H    ; i/o control
  53. GCD    EQU    47H    ; get current directory
  54. ALLOC    EQU    48H    ; allocate memory
  55. FREEMEM    EQU    49H    ; free memory
  56. SETBLK    EQU    4AH    ; modify allocated memory map
  57. EXEC    EQU    4BH    ; execute task
  58. FIRST2    EQU    4EH    ; search for first
  59. NEXT2    EQU    4FH    ; search for next
  60.  
  61. PAREVN    EQU    00    ; Even parity
  62. PARMRK    EQU    01    ; Mark parity
  63. PARNON    EQU    02    ; No parity.    
  64. PARODD    EQU    03    ; Odd parity
  65. PARSPC    EQU    04    ; Space parity
  66.  
  67. FLOXON    EQU    1113H    ; Use XON/XOFF for flow control
  68. FLONON    EQU    0    ; Don't do flow control
  69. DEFHAND    EQU    XON    ; Use XON as default handshake
  70.  
  71. MODCD    EQU    80H    ; MODEM CD handshake line status responses
  72. MODCTS    EQU    10H    ; MODEM CTS
  73. MODDSR    EQU    20H    ; MODEM DSR
  74.  
  75.             ; flags.remflg byte definitions
  76. DQUIET    EQU    1    ; Display mode, suppress file xfer statistics
  77. DREGULAR EQU    2    ; Regular formatted screen display of statistics
  78. DSERIAL    EQU    4    ; Serial mode (non-formatted screen)
  79. D8BIT    EQU    8    ; Display chars as 8-bit vs 7-bit quantities
  80. DSERVER    EQU    10H    ; Server mode active, if this bit is set
  81.  
  82. MAXTAK    EQU    25    ; Max number of TAKE's allowed
  83. DEFMXTRY EQU    5    ; default number of retries on a data packet (63 max)
  84.             ; Init packet gets three times this number of tries
  85.  
  86. DEFESC    EQU    1DH    ; The default escape character (Control rt sq bracket)
  87. DRPSIZ    EQU    94    ; Default receive packet size, regular pkts
  88. DSPSIZ    EQU    94    ; Default send packet size, regular pkts
  89. DSTIME    EQU    8    ; Default send time out interval
  90. DSQUOT    EQU    23H    ; Default send (and receive) quote char
  91. DQBIN    EQU    26H    ; Default 8-bit prefix
  92. DCHKLEN    EQU    1    ; Default checksum length
  93. DEFPAR    EQU    PARNON    ; Default parity (none) 
  94.  
  95. maxpack    equ    2000    ; max packet length. Sets buffer sizes, capabilities
  96. bufsiz    equ    1536    ; size of serial port input buffer
  97. buffsz    equ    512    ; size of disk file i/o buffer (buff)
  98. cptsiz    equ    256    ; size of session capture buffer
  99. tbufsiz    equ    128    ; size of Take buffers
  100. maxwind equ    31    ; max number of window slots
  101. macmax    equ    100    ; max number of macros
  102.  
  103.             ; bit defs for flags.capflg (LOG command)
  104. logoff    equ    0    ; Off = no or suspended logging
  105. logdeb    equ    1    ; log debugging (not yet imp)
  106. logpkt    equ    2    ; log packets sent/received
  107. logses    equ    4    ; log connect mode session
  108. logtrn    equ    8    ; log (file) transaction
  109.  
  110.             ; Attributes-allowed bits in flags.attflg 
  111. attchr    equ    1    ; File Character-set
  112. attdate    equ    2    ; File Date/Time
  113. attlen    equ    4    ; File Length
  114. atttype    equ    8    ; File Type
  115.  
  116. ; Terminal emulator section
  117.  
  118. ; Kinds of terminals available
  119. ttgenrc equ    0            ; Type 0: no emulation done by Kermit
  120. ttheath equ    1            ; Type 1: Heath-19
  121. ttvt52    equ    2            ; Type 2: VT52
  122. ttvt100    equ    3            ; Type 3: VT102
  123. ttvt320    equ    4            ; Type 4: VT320
  124. tttek    equ    5            ; Type 5: Tektronix 4010
  125. TTTYPES equ    6            ; Number of terminal types defined
  126.  
  127. ; DEC emulator status flags (bits in words vtemu.vtflgst and vtemu.vtflgop)
  128. anslnm  equ    1H            ; ANSI line feed/new line mode
  129. decawm  equ    2H            ; DEC autowrap mode
  130. decscnm equ    80H            ; DEC screen mode
  131. decckm  equ    200H            ; DEC cursor keys mode
  132. deckpam equ    400H            ; DEC keypad application mode
  133. decom   equ    800H            ; DEC origin mode
  134. deccol    equ    1000H            ; DEC column mode (0=80 col)
  135. decanm  equ    2000H            ; ANSI mode
  136. dececho equ    4000H            ; ANSI local echo on (1 = on)
  137.      
  138. ; Terminal SETUP mode flags (joint with bits above, some name dups)
  139. vsnewline    equ    1H        ; ANSI new line (0 = off)
  140. vswrap        equ    2H        ; Line wrap around (0 = no wrap)
  141. vsnrcm        equ    4H        ; National Rep Char set (0=none)
  142. vswdir        equ    8H        ; Writing direction (0=left, 1 right)
  143. vskeyclick    equ    10H        ; Keyclick (0 = off)
  144. vsmarginbell    equ    20H        ; Margin bell (0 = off)
  145. vscursor    equ    40H        ; Cursor (0 = block, 1 = underline)
  146. vsscreen    equ    80H        ; Screen (0 = normal, 1 = rev. video)
  147. vscntl        equ    100h        ; 8 or 7 bit controls (1 = 8-bit)
  148.      
  149. ; VTxxx defaults for SETUP
  150. ; Note: Tab stops default to columns 9, 17, 25, 33, etc
  151. ;
  152. ; VSDEFAULTS holds Kermit startup time settings for the VT100 emulator
  153. ; Configure it by adding together names from the setup mode flags above
  154. ; to turn on features (they default to being off if not mentioned).
  155. ; Set the kind of terminal by placing a ttxxxx name in VTFLGS in the
  156. ; FLGINFO structure well below.
  157.  
  158. vsdefaults    equ    0+vscursor    ; + your favorite conditions
  159.  
  160. emulst    struc            ; structure for terminal emulator global data
  161. vtflgst    dw    0        ; VT100 setup flags
  162. vtflgop    dw    0        ; VT100 runtime flags, like setup flags
  163. vttbs    dw    0        ; pointer to default tab stops 
  164. vttbst    dw    0        ; pointer to tab stops (both in mszibm)
  165. vtchset    db    15        ; value of default character set (15=Latin-1)
  166. vtchop    db    15        ; value of operational char set
  167. att_ptr    dw    0        ; pointer to video attributes: norm, rev
  168. emulst    ends
  169. ; end of terminal emulator section
  170.  
  171. ; Structure definitions
  172.  
  173. ifdef save_mem2            ; define only for Xenix builds
  174. save_mem equ    1        ; for Xenix
  175. endif
  176.  
  177. ifndef save_mem2        ; for regular DOS builds
  178. ; Command parser information
  179. cmdinfo    struc
  180. cmrprs    dw 0
  181. cmostp  dw 0
  182. cmprmp    dw 0        ; Address of prompt
  183. cmwhite    db 0        ; non-zero to permit leading whitespace
  184. cmcr    db 0        ; Say whether bare CR is allowed
  185. cmper    db 0        ; Allow literal backslash-percent in command
  186. cmquiet    db 0        ; non-zero for no echoing
  187. cmkeep    db 0        ; non-zero to keep Take/Macro open after EOF
  188. cmblen    db 0        ; length of caller's cmtxt receiving buffer
  189. impdo    db 0        ; non-zero for keyword search failure to use DO cmd
  190. cmdinfo    ends
  191.  
  192. ; Command parser equates
  193. cmkey    equ    1    ; parse a keyword
  194. cmeol    equ    4    ; parse a CR end of line character
  195. cmline    equ    5    ; parse line of text up to CR
  196. cmword    equ    6    ; parse an arbitrary word
  197.  
  198. endif
  199.  
  200. ; Flags information
  201. flginfo    struc
  202. belflg    db 1        ; Use bell
  203. comflg    db 1        ; Use COM1 by default
  204. abfflg    db 1        ; Discard incoming file if abort
  205. debug    db 0        ; Debugging mode (default off)
  206. flwflg    db 0        ; File warning (collision) flag (default rename)
  207. extflg    db 0        ; Exit flag (default off)
  208. vtflg    db ttvt320    ; term emulation type, default
  209. cxzflg    db 0        ; ^X/^Z to interrupt file x-fer
  210. xflg    db 0        ; Seen "X" packet
  211. eoflag    db 0        ; EOF flag; non-zero on EOF
  212. capflg    db 0        ; On if capturing data
  213. takflg    db 0        ; On if echoing commands of TAKE file
  214. timflg    db 1        ; Say if are timing out or not
  215. destflg    db 1        ; Incoming files destination: disk or printer
  216. eofcz    db 0        ; ^Z signals eof if non-zero
  217. remflg    db DREGULAR    ; server (remote) mode plus display flag bits
  218. modflg    db 1        ; non-zero if mode line on
  219. attflg    db 0ffh        ; non-zero if file attributes packets are enabled
  220. chrset    dw 0        ; ident of file character set (437=hardware, CP437)
  221. unkchs    db 0        ; files w/unknown-character-set (0=keep, 1=cancel)
  222. xltkbd    db 1        ; keyboard character-set translation (1=on, 0=off)
  223. flginfo    ends
  224.  
  225. ifndef save_mem2
  226. ; Transmission parameters
  227. trinfo    struc
  228. maxdat    dw 0        ; Max packet size for send, word for long packets
  229. chklen    db 1        ; Number of characters in checksum
  230. seol      db cr        ; Send EOL char
  231. reol      db cr        ; Receive EOL char
  232. ssoh      db soh        ; Send start-of-packet character
  233. rsoh      db soh        ; Receive start-of-packet character
  234. squote    db dsquot    ; Send quote character
  235. rquote    db dsquot    ; Receive quote character
  236. rptq    db 7eh        ; Repeat quote character (tilde)
  237. spsiz     db dspsiz    ; Send (regular) packet size
  238. rpsiz     db drpsiz    ; Receive (regular) packet size
  239. stime     db dstime    ; Send timeout. (Don't timeout)
  240. rtime     db 5        ; Receive timeout
  241. sdelay    db 0        ; Send delay time (sec) for just SEND command
  242. spad      db 0        ; Send number of padding char
  243. rpad      db 0        ; Receive number of padding char
  244. spadch    db 0        ; Send padding char
  245. rpadch    db 0        ; Receive padding char
  246. ebquot    db 'Y'        ; Send 8-bit quote character
  247. escchr    db defesc    ; Escape character
  248. capas    db 2,0        ; Capas bytes (just two for now)
  249. windo    db 1        ; number of window slots
  250. rlong    dw drpsiz    ; long pkt size we want to receive
  251. slong    dw maxpack    ; long pkt size we could send (negotiated with host)
  252. xchset    db 0        ; transfer char set (0=hardware) on comms wire
  253. xtype    db 0        ; file type for xfer (0=text,1=binary,etc)
  254. trinfo    ends
  255. endif
  256.  
  257. ifndef save_mem
  258. pktinfo    struc
  259. datadr    dw 0        ; data field address (offset from DS)
  260. datlen    dw 0        ; length of data field in a packet
  261. datsize    dw 0        ; length of data field buffer
  262. pktype    db 0        ; packet type, a letter
  263. seqnum    db 0        ; packet SEQ number
  264. ackdone    db 0        ; zero if pkt not ack'ed yet
  265. numtry    db 0        ; number of tries on this packet
  266. pktinfo    ends
  267. endif
  268.  
  269. filest    struc
  270. dta    db 26 dup(0)    ; DOS, 21 resev'd bytes, file attr, 2 each date & time
  271. sizelo    dw 0        ; DOS, file size double word
  272. sizehi    dw 0
  273. fname    db 13 dup(0)    ; DOS, filename, asciiz, with dot. End of DOS section
  274. handle    dw -1        ; Kermit, file handle
  275. string    db 64 dup(0)    ; Kermit, filename string, including drive and path
  276. fstat    db 0        ; Kermit, status of Find First DOS call
  277. filest    ends
  278.  
  279. takinfo    struc        ; Take file structure
  280. taktyp    db 0        ; type: 0FEh = valid file handle, 0FFh = a macro
  281. takhnd    dw 0        ; file handle
  282. takbuf    dw 0        ; offset of Take buffer
  283. takptr    dw 0        ; pointer in buffer to next char to read
  284. takcnt    dw 0        ; number of unread bytes in buffer
  285. takctr    dw 0        ; COUNT variable for script program control
  286. takargc    dw 0        ; argument quantity count
  287. takinfo ends
  288.  
  289. ; Port Information
  290. prtinfo    struc
  291. baud    dw 0        ; Default baud rate
  292. ecoflg    db 0        ; Local echo flag (default off)
  293. parflg    db 0        ; Parity flag (default none)
  294. floflg    db 0        ; If need flow control
  295. hndflg    db 0        ; If need handshake during file transfer
  296. hands    db 0        ; Default handshake
  297. flowc    dw 0        ; Do flow control with XON/XOFF
  298. duplex    db 0        ; Do full (0) or half (1) duplex comms
  299. portrdy db 0        ; Non-zero if comms port is still active
  300. prtinfo    ends
  301.                 ; ENABLE/DISABLE bits for denyflg
  302. cwdflg    equ    1        ; deny remote cwd
  303. delflg    equ    2        ; deny remote del
  304. dirflg    equ    4        ; deny remote dir
  305. hostflg    equ    8        ; deny remote host
  306. spcflg    equ    10H        ; deny remote space
  307. finflg    equ    20H        ; deny fin, bye, logo to server
  308. getsflg    equ    40H        ; deny paths in get cmds to server
  309. sndflg    equ    80H        ; deny paths in send cmds to server
  310. typflg    equ    100H        ; deny paths in type
  311. pasflg    equ    200h        ; username/password required
  312. kerflg    equ    400h        ; deny remote kermit
  313. tekxflg    equ    8000h        ; deny automatic Tektronix invokation
  314.  
  315. ifndef save_mem
  316. statinfo struc            ; statistics, basic information layout
  317. prbyte    dw    2 dup (0)    ; number of bytes received by port
  318. psbyte    dw    2 dup (0)    ; number of bytes sent to port
  319. frbyte    dw    2 dup (0)    ; bytes received
  320. fsbyte    dw    2 dup (0)    ; bytes sent
  321. prpkt    dw    2 dup (0)    ; number of packets received
  322. pspkt    dw    2 dup (0)    ; number of packets sent
  323. nakrcnt    dw    0        ; count of naks received
  324. nakscnt    dw    0        ; count of naks sent
  325. btime    dw    2 dup (0)    ; start time (seconds) of transfer
  326. etime    dw    2 dup (0)    ; elapsed time (seconds) of transfer
  327. pretry    dw    0        ; packet retries
  328. xstatus    db    0        ; transfer status
  329. xname    db    64 dup (0)    ; alias (send/receive as) filename
  330. statinfo ends
  331.  
  332. endif
  333.  
  334. scptinfo struc            ; scripts
  335. inactv    db    0        ; input action value (default proceed)
  336. incasv    db    0dfh        ; input case  (default ignore)
  337. indfto    dw    1        ; input and pause timeout (def 1 sec)
  338. inecho    db    1        ; echo Input cmd text (0 = no)
  339. xmitfill db    0        ; non-zero to TRANSMIT filler for blank line
  340. xmitlf    db    0        ; non-zero to TRANSMIT LF's
  341. xmitpmt    db    lf        ; default prompt for line acknowledgments
  342. scptinfo ends
  343.  
  344. ; definitions for terminal handler:
  345. termarg    struc
  346. flgs    db 0        ; flags
  347. prt    db 0        ; port to use (0,1,etc)
  348. captr    dw 0        ; routine to call with captured data
  349. baudb    db 0        ; baud rate bits
  350. parity    db 0        ; parity
  351. termarg    ends
  352.  
  353. ; bits for flag byte
  354. capt    equ 40h        ; capture output
  355. emheath    equ 20h        ; emulate heath
  356. trnctl    equ 08h        ; translate controls (debug)
  357. modoff    equ 04h        ; mode line off
  358. lclecho    equ 01h        ; local echo
  359.  
  360. mkeyw    macro    key,value    ; widely used data structure
  361.     local    keylen,start
  362. start    equ    $        ; remember start address of structure
  363.     db    keylen,key,'$'    ; length of "key", 'key','$'
  364. keylen    equ    $-start-2    ; number of bytes in "key"
  365.     dw    value
  366.     endm
  367. ;
  368. ; Note well. The following segment references are in THIS file to provide
  369. ; the desired ordering of them in memory. To wit: lowest addresses for
  370. ; 'code', followed by 'data', and only then by 'stack'.
  371. code    segment public 'code'
  372. code    ends
  373. code2    segment public 'code2'
  374. code2    ends
  375. data    segment public 'data'
  376. data    ends
  377. stack    segment para stack 'stack'
  378. stack    ends
  379.     .list
  380.